Skip to content

Preserve diagnostics with invalid help links - #1971

Open
Max Charlamb (max-charlamb) wants to merge 1 commit into
microsoft:mainfrom
max-charlamb:fix-invalid-diagnostic-help-link
Open

Max Charlamb (max-charlamb) wants to merge 1 commit into
microsoft:mainfrom
max-charlamb:fix-invalid-diagnostic-help-link

Conversation

@max-charlamb

@max-charlamb Max Charlamb (max-charlamb) commented Dec 4, 2026 •

Copy link
Copy Markdown

Fix for dotnet/vscode-csharp#10027

If the configured URI converter rejects an optional diagnostic help link, keep the diagnostic and its plain code rather than failing conversion for the document's diagnostic batch. Valid help links remain clickable, and URI conversion for document paths and other fields is unchanged.

The regression test uses the same strict URI parsing as the C# extension. It verifies that a diagnostic with a scheme-less link and a diagnostic with a valid link both survive the same batch, and only the valid link is clickable.

Validation (Node.js 22.17.0):

  • npm run compile:client-node-tests - passed.
  • npm --prefix client-node-tests test - 239 passed in VS Code Insiders; the new test failed with Scheme is missing before the fix.
  • npm --prefix client run lint and npm --prefix client-node-tests run lint - passed.
  • C# extension end-to-end smoke test - not run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 51b271d6-fd18-4b8c-a6b5-c5a8aec1267c
@max-charlamb
Max Charlamb (max-charlamb) marked this pull request as ready for review December 4, 2026 16:09
Copilot AI balanced review requested due to automatic review settings December 4, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change that preserves diagnostics when optional help-link conversion fails.

No open issues 🎉

What changed in this PR

Preserves diagnostics when a configured URI converter rejects an optional help link, without changing URI conversion for other fields.

Changes:

  • Falls back to the plain diagnostic code when help-link conversion fails.
  • Adds a regression test confirming invalid and valid links survive the same batch, with valid links remaining clickable.
File Description
client/​src/​common/​protocolConverter.ts Handles help-link conversion failures while preserving diagnostic codes.
client-node-tests/​src/​converter.test.ts Tests mixed valid and invalid help links with strict URI parsing.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants