Extend diagnostics to include notes/help/debug#4445
Merged
stefanvanburen merged 1 commit intomainfrom Apr 10, 2026
Merged
Conversation
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)
Contributor
|
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
stefanvanburen
commented
Apr 10, 2026
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. |
Member
Author
There was a problem hiding this comment.
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.
stefanvanburen
commented
Apr 10, 2026
| }, | ||
| 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", |
Member
Author
There was a problem hiding this comment.
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.)
doriable
approved these changes
Apr 10, 2026
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.
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.