For AI agents: the complete documentation index is available at https://rstack.rs/llms.txt, the full documentation bundle is available at https://rstack.rs/llms-full.txt, and this page is available as Markdown at https://rstack.rs/guide/ide-integration.md.
close
  • English
  • IDE integration

    Rstack currently provides official VS Code integration through the Rstack extension. The extension brings Rstack CLI's linting, formatting, and testing capabilities into the editor.

    Installation

    Install Rstack from the registry for your editor:

    You can also search for the extension identifier rstack.rstack in your editor's Extensions view.

    The extension does not bundle Rstack CLI. It uses the rstack package installed in the project's node_modules. Install the project dependencies first so the editor and CLI use the same Rstack CLI version.

    Configuration

    To use Rstack as the default formatter and format files on save, add the following settings:

    .vscode/settings.json
    {
      "editor.defaultFormatter": "rstack.rstack",
      "editor.formatOnSave": true
    }

    The following language-specific settings are optional. They prevent existing language-specific formatter preferences from overriding the workspace default. Add settings only for the languages your project needs:

    .vscode/settings.json
    {
      "[javascript]": { "editor.defaultFormatter": "rstack.rstack" },
      "[javascriptreact]": { "editor.defaultFormatter": "rstack.rstack" },
      "[json]": { "editor.defaultFormatter": "rstack.rstack" },
      "[json5]": { "editor.defaultFormatter": "rstack.rstack" },
      "[jsonc]": { "editor.defaultFormatter": "rstack.rstack" },
      "[markdown]": { "editor.defaultFormatter": "rstack.rstack" },
      "[mdx]": { "editor.defaultFormatter": "rstack.rstack" },
      "[toml]": { "editor.defaultFormatter": "rstack.rstack" },
      "[typescript]": { "editor.defaultFormatter": "rstack.rstack" },
      "[typescriptreact]": { "editor.defaultFormatter": "rstack.rstack" },
      "[yaml]": { "editor.defaultFormatter": "rstack.rstack" }
    }

    To apply lint fixes when you save a file manually, add:

    .vscode/settings.json
    {
      "editor.codeActionsOnSave": {
        "source.fixAll.rslint": "explicit"
      }
    }

    "explicit" applies lint fixes only on manual saves. Use "always" to apply them during auto-save as well.

    To recommend the extension to team members who open the repository, add it to the workspace recommendations:

    .vscode/extensions.json
    {
      "recommendations": ["rstack.rstack"]
    }

    Custom installation path

    By default, the extension looks for rstack in the workspace folder’s node_modules and then searches parent directories. If the rstack package is installed elsewhere, use rstack.rstackCli.packagePath to specify its location. For example:

    .vscode/settings.json
    {
      "rstack.rstackCli.packagePath": "infra/node_modules/rstack"
    }

    Set the path to the rstack package directory or its package.json file. Relative paths are resolved from the workspace folder. Absolute paths and the ${workspaceFolder} placeholder are also supported.

    Features

    Linting

    Shows lint diagnostics as you edit, provides quick fixes, and fixes issues on save.

    Formatting

    Formats documents through the project-local rs fmt language server. It loads define.fmt() from rstack.config.* at the workspace root, keeping the editor and CLI on the same formatting rules.

    Testing

    Adds project tests to VS Code's Test Explorer. You can run or debug an individual test, suite, or file, and failed tests also appear as editor diagnostics.

    Troubleshooting

    The Rstack status bar item shows the active features and their status, including configuration discovery and version compatibility problems. If its status does not update after installing dependencies or editing configuration, open the Command Palette and run Rstack: Relaunch Extension.

    For more usage details, see the extension documentation.

    Report bugs and feature requests through Rstack Editor Issues.