> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Editor (language server)

> Set up Loadwise diagnostics in your editor and verify a finding.

Run this once from your editor’s terminal with a Loadwise version that includes editor setup:

```sh theme={null}
npx loadwise@latest editor setup
```

Editor setup requires Loadwise 0.7.0 or later. If bare `npx loadwise editor setup` says `check accepts at most one directory`, npm selected an older project dependency. The `@latest` command uses the latest published CLI for setup and leaves the project pin intact. Use the bare command to select a compatible project-pinned version.

Use `--editor <name>` to select a client explicitly. Automated tests cover setup commands, generated settings and the language server’s diagnostics. To verify the connection in your editor, open the [quickstart example](https://loadwise.mintlify.site/quickstart.md#try-a-finding-and-a-fix) in an included source folder and look for `array-repeated-membership`.

| Editor | Setup name | Requirements |
| - | - | - |
| VS Code, VSCodium, Grok Build (formerly Cursor), Devin (formerly Windsurf), Antigravity IDE | `code`, `codium`, `cursor`, `windsurf` or `devin`, `antigravity-ide` | Compatible desktop extension host and CLI launcher. Open a trusted workspace after installation. |
| IntelliJ IDEA, WebStorm, PyCharm, Rider and other compatible JetBrains IDEs | `jetbrains` | Install LSP4IJ, then import the generated template. |
| Neovim, Helix, Emacs, Vim | `nvim`, `helix`, `emacs`, `vim` | Neovim 0.11+, Helix 23.10+, Eglot or vim-lsp respectively. Follow the printed activation or merge steps. |
| Zed, Sublime Text | `zed`, `sublime` | Zed: setup installs the prebuilt extension from the npm package. Sublime Text: LSP package. |
| Eclipse or another configurable LSP client | `stdio` | Register the printed command and arguments. Eclipse uses LSP4E. [Eclipse setup guide](https://github.com/IbrahimHafez1/loadwise/blob/main/integrations/eclipse/README.md) |
| Visual Studio desktop, Xcode | Terminal | Run `npx loadwise check` in the project folder. |

## VS Code, VSCodium, Grok Build, Devin and Antigravity IDE

For Devin, `npx loadwise editor setup --editor windsurf` (or `--editor devin`) finds the `devin-desktop` launcher, `Devin.exe` under `Programs\Devin` on Windows or `Devin.app` on macOS, and still accepts the older `windsurf` names. If setup cannot find the launcher, install the editor or add its `bin` folder to `PATH`, or pick another editor with `--editor`.

The extension requires a desktop host compatible with the VS Code 1.101 extension API. It bundles the language server and checkers and supports trusted local folders and multi-root workspaces. Each folder uses a compatible local CLI when available. Reload the editor window after adding or removing the project dependency. To select a particular CLI, set `loadwise.cli` to its absolute script path.

Setup downloads the VSIX from the GitHub release matching your CLI version and installs it using your editor’s launcher. You can choose a product explicitly, for example `npx loadwise editor setup --editor cursor`. Loadwise still looks for the `cursor` launcher. Installation through the renamed desktop launcher has yet to be verified. [Grok Build desktop installation guide](https://docs.grok.com/build/agents-window/help/getting-started/install)

You can also install the VSIX directly using **Extensions → … → Install from VSIX…**. Choose the build for your editor's operating system and processor. The filename is `loadwise-<version>-<platform>-<arch>.vsix`, where platform is `win32`, `darwin`, or `linux` (glibc), and arch is `x64` or `arm64`. On Windows x64, for example, choose the file ending in `-win32-x64.vsix`. Direct installation uses the editor's runtime and works without installing the Loadwise npm package in your project.

For a development build, download the matching VSIX artifact from a successful GitHub Actions **check** run or build it from a Loadwise checkout with `npm ci`, `npm ci --prefix editor`, and `npm run editor:package`. The local build writes the VSIX to `editor/dist/`. For a CLI version without a published release asset, install the local VSIX through the editor or pass `--vsix <path-to-file>` to `loadwise editor setup`. [Release assets](https://github.com/IbrahimHafez1/loadwise/releases) · [CI build artifacts](https://github.com/IbrahimHafez1/loadwise/actions/workflows/check.yml)

### Migrate an existing setup

If you previously launched Loadwise through Simple LSP Client, remove just the `loadwise` entry inside `simpleLspClient.servers` wherever you added it (user settings, workspace settings, or a folder's `.vscode/settings.json`). For another generic LSP client, remove its Loadwise server registration. This prevents two servers reporting the same findings. Keep other language servers and any Loadwise npm dependency used by CI or terminal scripts. Reload the editor window.

### Verify diagnostics

Open an included source file with a Loadwise finding and look in **View → Problems** for its rule ID. Hover the diagnostic for details or use **Quick Fix** (Ctrl+. on Windows and Linux) to see available actions. For a known example, use the sample from the [quickstart](https://loadwise.mintlify.site/quickstart.md#try-a-finding-and-a-fix) and look for `array-repeated-membership`. To opt into eligible fixes on explicit saves, add `"editor.codeActionsOnSave": { "source.fixAll.loadwise": "explicit" }` to your editor settings.

Use the command palette's **Loadwise: Rescan Workspace** to scan on demand or **Loadwise: Manage Dismissed Findings** to restore a dismissal.

To use the `checkers` list from each workspace folder's policy, enable `loadwise.useProjectCheckers`. Leave it off to run all applicable editor checks. LSP clients outside the desktop extension can send `{ "loadwise": { "useProjectCheckers": true } }` in their initialization options.

With [shared configuration](https://loadwise.mintlify.site/configuration.md#shared-configuration), the editor also watches inherited policies within the opened folder or its enclosing Git repository. It limits each inherited policy to 256 KiB. When project checker selection is enabled, the same size limit applies to the workspace's own policy. `loadwise editor doctor` reports the effective checker list for the directory it inspects.

## Set up a custom stdio LSP client

For an editor with a configurable Language Server Protocol (LSP) client, run `npx loadwise editor setup --editor stdio` once. It prints a JSON object containing the executable (`command`) and its separate arguments (`args`). Register those values with your client, select stdio transport, and use the project folder as the working directory. Use this route even if your editor is missing from the examples below. The client controls which diagnostics, hovers and code actions it displays.

For an editor without a configurable LSP client, you can still scan the same project by running `npx loadwise check` from its terminal or external tools menu. An editor with a SARIF viewer can also open a saved report from `npx loadwise check --format sarif > loadwise.sarif`. A saved report shows findings from that scan. Live updates and inline fixes require an editor client.

For manual snippets below, substitute the executable from `command` and the CLI path from `args[0]`. The prepared runtime lives in your user data directory and can serve multiple projects.

## Editor examples

### JetBrains IDEs

Run `npx loadwise editor setup --editor jetbrains`. Install LSP4IJ from **Settings → Plugins**. In **Settings → Languages & Frameworks → Language Servers (LSP4IJ)**, click **+**, choose **Template → Import from custom template**, select the folder printed by setup and confirm. Open a matching file and look for Loadwise in **LSP Consoles**. When upgrading, update your existing registration with the command in the regenerated template. Template generation and filename mappings are tested. [LSP4IJ import guide](https://github.com/redhat-developer/lsp4ij/blob/main/docs/UserDefinedLanguageServer.md#custom-template)

### Visual Studio desktop and Xcode

Run `npx loadwise check` from a terminal in the project folder. In Visual Studio desktop you can also add a **Tools → External Tools** command. Run setup with `--editor stdio`, use the printed Node executable as **Command**, and enter the quoted CLI path from `args[0]` followed by `check` as **Arguments**. Set the initial directory to `$(SolutionDir)` and select **Use Output window**. This runs a scan on demand. [Visual Studio External Tools](https://learn.microsoft.com/en-us/visualstudio/ide/managing-external-tools)

### Neovim

For Neovim 0.11+ (`init.lua`), use the built-in client. It looks for a project marker, including a Ruby `Gemfile`, and falls back to the source file's directory. With an older version, register the same command and filetypes as a custom nvim-lspconfig server.

```lua theme={null}
vim.lsp.config('loadwise', {
  cmd = { 'node', '/absolute/path/to/loadwise.js', 'lsp', '--stdio' },
  filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'python', 'ruby', 'php', 'kotlin', 'c', 'cpp' },
  root_dir = function(bufnr, on_dir)
    local file = vim.api.nvim_buf_get_name(bufnr)
    if file == '' then return end
    local root = vim.fs.root(bufnr, { 'loadwise.config.json', 'tsconfig.json', 'jsconfig.json', 'package.json', 'Gemfile', '.git' })
    on_dir(root or vim.fs.dirname(file))
  end,
  init_options = { loadwise = { severity = 'default' } },
})
vim.lsp.enable('loadwise')
```

### Helix

Add Loadwise alongside your language's existing servers in [`languages.toml`](https://docs.helix-editor.com/languages.html).

```toml theme={null}
[language-server.loadwise]
command = "node"
args = ["/absolute/path/to/loadwise.js", "lsp", "--stdio"]

[[language]]
name = "typescript"
language-servers = ["typescript-language-server", "loadwise"]
```

### Zed

Run `npx loadwise editor setup --editor zed`, then restart Zed. Setup prepares a user-level Loadwise server and copies the prebuilt Loadwise extension from the npm package into Zed's installed extensions, so you need neither Rust nor a development extension. Open a supported source file in a trusted project folder. If you customized that language's `language_servers` list, include `"loadwise"` alongside its other servers.

The extension chooses the server when Zed starts it, in this order:

1. `lsp.loadwise.binary.path` and `lsp.loadwise.binary.arguments` from Zed settings. List every argument, ending with `lsp` and `--stdio`; `npx loadwise editor setup --editor stdio` prints both values.
2. The project's own `node_modules/loadwise`, run with Node, when the root `package.json` lists `loadwise` as a dependency.
3. The user-level server recorded by the last `editor setup --editor zed`.
4. `loadwise` on your `PATH`.

Every path is passed as a separate argument, so paths with spaces need no quoting. Zed starts no language server, including Loadwise, in a worktree you have not trusted. After upgrading Loadwise, rerun setup to point Zed at the new server; the extension itself does not change. If you used an earlier Loadwise development extension, setup replaces it. Setup also adds `"auto_update_extensions": { "loadwise": false }` to Zed's user settings, keeping comments and other settings, so Zed's automatic updates never replace this extension with a registry extension that uses the same id. Installing that registry extension by hand from Zed's extensions page still replaces it; rerun setup to restore it. If the settings file cannot be merged safely, setup leaves it unchanged and prints the line to add. To work on the extension, run `npm run build:zed` in a Loadwise checkout with Rust and the `wasm32-wasip2` target. A checkout without that build makes setup prepare a development extension to install with **zed: install dev extension**. [Zed language server settings](https://zed.dev/docs/configuring-languages#configuring-language-servers)

### Sublime Text

In Sublime Text 4, install **LSP** using Package Control. Run `npx loadwise editor setup --editor sublime`. Setup registers a separate `LSP-loadwise` helper in the standard Packages folder and prints its location. For a portable or custom profile, use **Preferences → Browse Packages** and copy the generated `LSP-loadwise` folder there. Open a project folder and a supported source file. If you previously added a manual `loadwise` client in LSP settings, remove that one entry to avoid duplicate diagnostics. [Sublime LSP documentation](https://lsp.sublimetext.io/)

To verify diagnostics, open the [quickstart example](https://loadwise.mintlify.site/quickstart.md#try-a-finding-and-a-fix) in a TypeScript project and look for `array-repeated-membership` from `loadwise perf` in the LSP diagnostics. This passed on Windows 11 with portable Sublime Text 4 build 4215, Package Control 4.2.7, and LSP 2.16.0. [Tested Loadwise revision](https://github.com/IbrahimHafez1/loadwise/commit/f3a3342d008c2eb09e96a96edc37a0f9d5af1b0a)

### Emacs

With Eglot, Loadwise takes the place of another server for these modes because Eglot runs one server per buffer.

```elisp theme={null}
(with-eval-after-load 'eglot
  (add-to-list 'eglot-server-programs
               '((js-mode js-ts-mode typescript-ts-mode tsx-ts-mode python-mode python-ts-mode kotlin-mode)
                 . ("node" "/absolute/path/to/loadwise.js" "lsp" "--stdio"))))
```

**What you see.** Each finding is a diagnostic with its checker as the source (`loadwise perf`, `loadwise maint`, `loadwise sec`) and its rule as the code, linked to the rule's page, with related locations such as the other imports of a dependency cycle. Rule levels from `loadwise.config.json` decide the severity: by default declared contract violations are errors and other findings warnings. Live-database findings appear on the first line of `package.json`. Hovers show the recommendation, the finding and the before and after code. Code actions are **Apply fix: \<rule>**, **Dismiss this finding**, **Dismiss \<rule> in this file** and **Apply all Loadwise fixes in this file**, and code lenses put **Apply fix**, **Dismiss** and **Apply all** above fixable lines. Multi-file fixes apply all-or-nothing, never overwrite an existing file and refuse code that changed since the scan, including unsaved editor text. `source.fixAll.loadwise` applies every eligible fix in the file as one undoable edit and leaves fixes that need individual review for **Apply fix**. A dismissal follows its occurrence of the flagged text across unrelated line shifts. When the matching group or its surrounding code changes, the editor shows the occurrences for review again. Older line-only dismissals apply only when one finding matches; dismissals are saved in `.loadwise/dismissed.json` at the workspace folder root, which you can commit to share them.

**What gets scanned.** Each workspace folder is scanned on start and after every change to a source file, `schema.prisma`, a SQL migration, `package.json`, `tsconfig*.json`, `jsconfig*.json`, `loadwise.config.json` or `.loadwise/dismissed.json`, whether from the editor, git or another tool; a completed source scan in the project terminal refreshes it too. Performance, reliability, accessibility and security's source checks come from an incremental `loadwise perf --watch` process; maintainability and security's project-file checks (secrets, Dockerfiles, workflows and other manifests) rerun on each change, and the polyglot rules run when the folder has Python, Go, Java, C# or Rust files. Kotlin files also trigger the standalone reliability scan. The default project is a root `tsconfig.json` or `jsconfig.json`; in a monorepo, open packages as workspace folders or set `project`. If the client does not send watched-file events, run `loadwise.scan` from the editor after another tool changes a dismissal or rule configuration. The command reloads dismissals and rescans every open workspace folder. Scan counts and errors go to the editor's language server log.

| Command | Action |
| - | - |
| `loadwise.scan` | Rescan every workspace folder now |
| `loadwise.applyFix` | Apply one fix (from a code action or code lens) |
| `loadwise.applyAllFixes` | Apply every eligible fix in a file (its URI as argument) |
| `loadwise.dismiss` | Dismiss a finding or a rule in a file |
| `loadwise.showDismissed` | List dismissed findings, with Restore and Restore all |
| `loadwise.restoreDismissed` | Restore the given dismissal, or every one without argument |

Settings go in the client's `initializationOptions` or its `loadwise` configuration section (per workspace folder when the editor supports it):

| Setting | Default | Effect |
| - | - | - |
| `enabled` | `true` | Show diagnostics for the folder |
| `project` | `""` | TypeScript or JavaScript project config, relative to the folder |
| `cli` | `""` | Absolute path to another `dist/bin/loadwise.js`, such as a development build |
| `severity` | `"default"` | `error`, `warning`, `information` or `hint` shows every finding at that level |
| `codeLens` | `true` | Show the Apply fix and Dismiss code lenses |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.