Skip to content

Commit b845193

Browse files
Deduplicate LSP symbol references (#4107)
1 parent 1ca4ec4 commit b845193

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

private/buf/buflsp/server.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"strings"
2323
"unicode/utf16"
2424

25+
"buf.build/go/standard/xslices"
2526
"github.com/bufbuild/buf/private/buf/bufformat"
2627
"github.com/bufbuild/protocompile/experimental/ir"
2728
"github.com/bufbuild/protocompile/parser"
@@ -442,7 +443,9 @@ func (s *server) References(
442443
if symbol == nil {
443444
return nil, nil
444445
}
445-
return symbol.References(), nil
446+
// TODO: Determine why we have duplicate references here, and fix that instead of deduplicating at
447+
// this level.
448+
return xslices.Deduplicate(symbol.References()), nil
446449
}
447450

448451
// Completion is the entry point for code completion.

0 commit comments

Comments
 (0)