Delphi-RAG-Lint

drag-lint help

Switch VS Code Delphi MCP entry

Since: 1.33.0-alpha

Turns the VS Code Delphi MCP entry off and on with a backup.

Read this when VS Code's own Delphi MCP server and drag-lint should not both run. drag-lint-switch removes the entry with a backup and restores it later.

Details

The LSP stream's feature page: the DelphiLSP proxy merge and the three other LSP-owned features (protocol extensions, full rule set on save, the VS Code switch). The full flag reference is lsp; this page says what each feature is for and how it was verified.

Proxy merge

drag-lint lsp --proxy relays every message between the editor and RAD Studio's DelphiLSP. Four opt-in flags add drag-lint answers to DelphiLSP's, so one session shows the compiler's errors and drag-lint's findings together:

flagmerged answer
--merge-diagnosticsdrag-lint findings appended to publishDiagnostics, tagged source: "drag-lint"
--merge-completiondrag-lint items unioned into the completion reply, keyed on label and kind
--merge-hoverdrag-lint hover facts appended after a --- rule
--merge-definitiondrag-lint locations when DelphiLSP answers null or empty; also references and workspace symbols
--merge-budget-msper-frame time budget, default 300
--delphi-lsp-bits32 forwards to the 32-bit DelphiLSP, 64 (default) to bin64

With every merge flag off the proxy relays DelphiLSP's bytes unchanged. Merging fails open: a handler that overruns the budget, raises or finds no index makes the proxy forward DelphiLSP's original bytes.

Guards: tests\autotest\run_lsp_proxy_*_guard.ps1.

Protocol extensions

Without a proxy, drag-lint lsp answers from the index: textDocument/documentSymbol, implementation, declaration, prepareRename / rename, codeLens (caller counts), semanticTokens/full, inlayHint, workspace/executeCommand (draglint.showCallers) and the draglint/ping request. The per-method behaviour is in lsp.

Full rule set on save

drag-lint lsp --full-rules runs drag-lint lint "file" --json on save, so the editor shows the same findings as the CLI, including dl:ok review markers. Without the flag the server keeps its small built-in check set unchanged.

VS Code switch

drag-lint-switch.exe switches VS Code's Delphi MCP entry off and on (drag-lint-switch --vscode --off / --on), keeping a whole-file backup of the mcp.json it edits. See the end of lsp.

Verification

The proxy merge and the extensions are covered by fixture guards that drive the built engine over stdio with a stub DelphiLSP; each names a positive control so that a silent run cannot pass with the feature off. Run the targeted set with tests\autotest\run_lsp_*_guard.ps1.


All features | CLI reference | IDE menus