Repository navigation
Preserve diagnostics with invalid help links - #1971
Open
Max Charlamb (max-charlamb) wants to merge 1 commit into
Open
Max Charlamb (max-charlamb) wants to merge 1 commit into
Max Charlamb (max-charlamb) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 51b271d6-fd18-4b8c-a6b5-c5a8aec1267c
There was a problem hiding this comment.
🟢 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 withScheme is missingbefore the fix.npm --prefix client run lintandnpm --prefix client-node-tests run lint- passed.