VS Code extension
Run the same rules as the CLI inline in your editor.
Installation
- Install NestJS Doctor from the VS Code Marketplace.
- Add
nestjs-doctoras a dev dependency in your project:
npm install -D nestjs-doctorThe extension's LSP server loads nestjs-doctor from your workspace node_modules, so the dev dependency is required.
The CLI prints one line pointing at the extension and the language server on the first console scan in a terminal on a machine, never in CI, and never again after that.
How it works
The extension activates automatically when your workspace contains @nestjs/core in node_modules or when you open a TypeScript file. It starts a Language Server (LSP) that runs nestjs-doctor's analysis in the background using the incremental scanning API. That server also runs on its own, in any other editor that speaks LSP.
Diagnostics appear inline and in the Problems panel, the same as TypeScript or ESLint errors. The status bar shows a summary while scanning.
Features
- Inline diagnostics: warnings and errors are underlined, with hover details.
- Problems panel: every diagnostic is listed for navigation.
- Status bar: shows scan progress and a summary of findings.
- Scans: on open, on save after a debounce, on any
package.jsonchange, and on demand from the command palette.
Configuration
All settings are under the nestjsDoctor namespace in VS Code settings.
| Setting | Type | Default | Description |
|---|---|---|---|
nestjsDoctor.enable | boolean | true | Enable or disable NestJS Doctor analysis entirely |
nestjsDoctor.scanOnSave | boolean | true | Re-scan the saved file automatically |
nestjsDoctor.scanOnOpen | boolean | true | Run a full scan when the workspace opens |
nestjsDoctor.debounceMs | number | 200 | Debounce delay in milliseconds before re-scanning after save |
Set them in your VS Code settings.json:
{
"nestjsDoctor.enable": true,
"nestjsDoctor.scanOnSave": true,
"nestjsDoctor.scanOnOpen": true,
"nestjsDoctor.debounceMs": 200
}The extension also respects your project's nestjs-doctor.config.json for rule configuration, ignore patterns, and custom rules. See Configuration for details.
Commands
Open the command palette (Cmd+Shift+P / Ctrl+Shift+P) and run
NestJS Doctor: Scan Project to force a full scan.
Troubleshooting
Install both dependencies first:
npm install
npm install -D nestjs-doctorThe extension activates on @nestjs/core in node_modules, and the LSP server
loads the engine from nestjs-doctor. Neither is optional.
Run NestJS Doctor: Scan Project when diagnostics look stale. A rule disabled
in nestjs-doctor.config.json produces no diagnostics in the editor either,
because the extension reads the same file as the CLI. See
Configuration.