Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

VS Code Extension

rx includes a VS Code extension located in the editors/vscode/ directory of the repository. It provides editor integration for all major rx commands.

Installation

Build and install the extension from source:

cd editors/vscode
npm install
npm run compile
# Then install the .vsix file, or use "Developer: Install Extension from Location"

The extension activates automatically when a workspace contains Cargo.toml or rx.toml.

Commands

The extension provides commands accessible from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

CommandDescription
rx: BuildRun rx build
rx: Build (Release)Run rx build --release
rx: TestRun rx test
rx: FormatRun rx fmt
rx: LintRun rx lint
rx: CheckRun rx check
rx: FixRun rx fix
rx: Run CIRun rx ci
rx: CleanRun rx clean
rx: DoctorRun rx doctor
rx: Workspace GraphRun rx graph
rx: List TasksRun rx run

Task provider

The extension includes a VS Code task provider. Define tasks in .vscode/tasks.json:

{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "rx",
      "command": "build --release",
      "label": "rx: Release Build"
    },
    {
      "type": "rx",
      "command": "test",
      "profile": "ci",
      "label": "rx: Test (CI profile)"
    }
  ]
}

Task properties:

PropertyRequiredDescription
commandYesThe rx command to run
profileNoConfig profile to use

Auto-check on save

When rx.autoCheck is enabled (the default), the extension runs rx check automatically every time you save a Rust file. Errors and warnings appear in the Problems panel.

Disable it in VS Code settings:

{
  "rx.autoCheck": false
}

Problem matchers

The extension includes a problem matcher that parses Rust compiler errors and warnings from rx output. Errors appear as squiggly underlines in the editor and in the Problems panel, with clickable file/line references.

Settings

SettingDefaultDescription
rx.path"rx"Path to the rx binary. Set this if rx is not on your PATH.
rx.autoChecktrueRun rx check automatically on save.
rx.profile""Default config profile. If set, all commands use this profile.

Tips

  • Use rx: Watch to start continuous rebuilding in a terminal panel
  • The rx: Fix command is useful as a keyboard shortcut for quick auto-fixing
  • Set rx.profile to switch between development and CI configurations without editing rx.toml
  • Task definitions support the profile property, so you can create tasks for different profiles