VS Code extension

Run the same rules as the CLI inline in your editor.

Installation

  1. Install NestJS Doctor from the VS Code Marketplace.
  2. Add nestjs-doctor as a dev dependency in your project:
npm install -D nestjs-doctor

The 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.json change, and on demand from the command palette.

Configuration

All settings are under the nestjsDoctor namespace in VS Code settings.

SettingTypeDefaultDescription
nestjsDoctor.enablebooleantrueEnable or disable NestJS Doctor analysis entirely
nestjsDoctor.scanOnSavebooleantrueRe-scan the saved file automatically
nestjsDoctor.scanOnOpenbooleantrueRun a full scan when the workspace opens
nestjsDoctor.debounceMsnumber200Debounce 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-doctor

The 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.