Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [Unreleased]

- Add `textDocument/rename` and `textDocument/prepareRename` support for `buf lsp serve`.
- Fix panic in LSP for empty option paths.

## [v1.61.0] - 2025-11-25

Expand Down
5 changes: 5 additions & 0 deletions private/buf/buflsp/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,11 @@ func (f *file) messageToSymbolsHelper(msg ir.MessageValue, index int, parents []
for element := range seq.Values(field.Elements()) {
key := field.KeyASTs().At(element.ValueNodeIndex())
components := slices.Collect(key.AsPath().Components)
// If there are no path components for an element, then we skip it, since there are
// no symbols to track.
if len(components) == 0 {
continue
}
var span source.Span
// This covers the first case in the example above where the path is relative,
// e.g. field_a is a relative path within { } for (option).message.
Expand Down