Skip to content

Extend diagnostics to include notes/help/debug#4445

Merged
stefanvanburen merged 1 commit intomainfrom
svanburen/diagnostics
Apr 10, 2026
Merged

Extend diagnostics to include notes/help/debug#4445
stefanvanburen merged 1 commit intomainfrom
svanburen/diagnostics

Conversation

@stefanvanburen
Copy link
Copy Markdown
Member

Quick follow-up to #4439. In that PR, we mentioned that these fields could become code actions, which is probably true with some refactoring / exporting of more of the underlying structure so we don't have just strings without more structured data. For now, it seems valuable to just expose these as additional information added to the hover states. See the added test-cases for how these look.

Quick follow-up to #4439. In that PR, we mentioned that these [fields
could become code actions][1], which is probably true with some
refactoring / exporting of more of the underlying structure so we don't
have just `string`s without more structured data. For now, it seems
valuable to just expose these as additional information added to the
hover states. See the added test-cases for how these look.

[1]: #4439 (comment)
@github-actions
Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 10, 2026, 3:03 PM

Comment on lines +53 to +54
// Debug info is implementation-level detail; only include it for ICE where
// all available context helps diagnose the unexpected failure.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

was just checking where we Debugf in protocompile; this logic is the same as before, just updates the format to debug: similar to the other added types.

},
Severity: protocol.DiagnosticSeverityError,
Source: "buf-lsp",
Message: "expected map key type, found enum type `diagnostics.v1.Status`\nhelp: valid map key types are integer types, `string`, and `bool`\nhelp: counterintuitively, user-defined enum types cannot be used as keys",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this sort of thing seems very valuable to include in our hover diagnostics, as it really points to how to solve the issue. (I do think another follow up of adding code actions to resolve these, where possible, would be great, though.)

@stefanvanburen stefanvanburen merged commit 40154e3 into main Apr 10, 2026
11 checks passed
@stefanvanburen stefanvanburen deleted the svanburen/diagnostics branch April 10, 2026 18:37
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