Commit d8ef53b
lsp: emit VS-internal HiddenInEditor tag for unnecessary diagnostics
The LSP spec says clients are "allowed to render diagnostics [tagged
Unnecessary] faded out instead of having an error squiggle." Visual
Studio's LSP client, however, only renders the faded "unused" appearance
when a diagnostic carries both DiagnosticTag.Unnecessary AND the
VS-internal VSDiagnosticTags.HiddenInEditor tag; with just Unnecessary
the diagnostic shows as a normal squiggle.
When the client advertises _vs_supportsVisualStudioExtensions, also emit
HiddenInEditor (int32.MaxValue - 6 = 2147483641) so unused variables and
similar diagnostics render faded in Visual Studio. Non-VS clients
continue to receive only the standard LSP tags.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 913fed9 commit d8ef53b
2 files changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
306 | 313 | | |
307 | 314 | | |
308 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
315 | 326 | | |
0 commit comments