Handle files that have not completed lowering in LSP#4439
Merged
Conversation
Contributor
|
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
Member
stefanvanburen
left a comment
There was a problem hiding this comment.
👍, just a quick drive-by
private/buf/buflsp/file.go
Outdated
Comment on lines
+365
to
+366
| Message: fmt.Sprintf(`the symbols for this file have not been fully resolved due to an invalid version of descriptor.proto located at: %q. | ||
| this is likely due to a vendored descriptor.proto.`, |
Member
There was a problem hiding this comment.
nit: I think the diagnostics tend to be sentence-cased?
Suggested change
| Message: fmt.Sprintf(`the symbols for this file have not been fully resolved due to an invalid version of descriptor.proto located at: %q. | |
| this is likely due to a vendored descriptor.proto.`, | |
| Message: fmt.Sprintf(`The symbols for this file have not been fully resolved due to an invalid version of descriptor.proto located at: %q. | |
| This is likely due to a vendored descriptor.proto.`, |
Comment on lines
+46
to
+51
| message := reportDiagnostic.Message() | ||
| if reportDiagnostic.Level() == report.ICE { | ||
| // Include notes for ICE | ||
| notes := append([]string{message}, reportDiagnostic.Notes()...) | ||
| message = strings.Join(notes, " ") | ||
| } |
Member
There was a problem hiding this comment.
neat; separately, feels like we ought to integrate .Notes() / .Help() / .Debug() somehow when they're available, and not just conditionally?
Member
Author
There was a problem hiding this comment.
Yeah -- I think the follow-up once the compiler is fully ported, and the Help/Debug in particular are reaching much stabler state than when the LSP was first launched, we should turn them into code actions. So there's definitely some follow-up improvements to do here.
stefanvanburen
approved these changes
Apr 10, 2026
emcfarlane
approved these changes
Apr 10, 2026
stefanvanburen
added a commit
that referenced
this pull request
Apr 10, 2026
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)
stefanvanburen
added a commit
that referenced
this pull request
Apr 10, 2026
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)
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.
This implements more graceful behaviour in the LSP for when
a file is unable to go through the full lowering process, and therefore
cannot/does not have fully resolved symbols for LSP functionality, and
attempts to return the most helpful possible diagnostic to the user to
communicate this.
Fixes #4434