fix: playground not dimming unused `using` statements (#10815)
The playground wasn't fading out unused `using` declarations the way the VS Code extension does, even though the language server was already detecting them correctly. **Root cause:** The language server running in the playground (for completions, hover, semantic tokens, etc.) was sending LSP diagnostics with `DiagnosticTag.Unnecessary` for unused `using` statements, but `sendDiagnostics` in `services.ts` was a no-op — those tags were never forwarded to Monaco. ## Changes - **`packages/playground/src/services.ts`** — Implement `sendDiagnostics` to filter diagnostics that carry visual tags and apply them as Monaco `Hint`-severity markers under a separate `"lsp-tags"` owner. Using `Hint` avoids duplicating the error/warning squiggles already managed by the playground's own compilation pass. `DiagnosticTag` values from LSP map directly to `MarkerTag` values in Monaco (`Unnecessary = 1`, `Deprecated = 2`). - **`packages/playground/src/react/playground.tsx`** — Fix a pre-existing bug where `CompletionItemTag.Deprecated` (value `1`, from `vscode-languageserver`) was used as a Monaco marker tag. This coincidentally equals `MarkerTag.Unnecessary` (faded text) rather than the intended `MarkerTag.Deprecated` (strikethrough). Replaced with `MarkerTag.Deprecated` and removed the `vscode-languageserver` import. <img width="469" height="200" alt="image" src="https://github.com/user-attachments/assets/587567b3-6c1d-4243-8257-93fb6a6fc977" /> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> Co-authored-by: Timothee Guerin <tiguerin@microsoft.com>
C
Copilot committed
ebbb9a2d41350821908f006fbdab336990609b1e
Parent: a3dcc53
Committed by GitHub <noreply@github.com>
on 5/29/2026, 8:16:34 PM