Skip to content

Commit 643b24b

Browse files
authored
Upgrade protocompile and clean up unused param (#4188)
1 parent a20723d commit 643b24b

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Disable format on unknown or invalid syntax.
66
- Fix regression in LSP functionality for well-known types.
77
- Fix browser open for `buf registry login` in WSL2.
8+
- Fix panic in LSP for EOF lookups.
89

910
## [v1.60.0] - 2025-11-14
1011

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
buf.build/go/standard v0.1.0
1717
connectrpc.com/connect v1.19.1
1818
connectrpc.com/otelconnect v0.8.0
19-
github.com/bufbuild/protocompile v0.14.2-0.20251112213711-9afd4296dfe2
19+
github.com/bufbuild/protocompile v0.14.2-0.20251120233202-3f9009bcd6c8
2020
github.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1
2121
github.com/cli/browser v1.3.0
2222
github.com/docker/docker v28.5.2+incompatible

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ github.com/bmatcuk/doublestar/v4 v4.9.1 h1:X8jg9rRZmJd4yRy7ZeNDRnM+T3ZfHv15JiBJ/
4242
github.com/bmatcuk/doublestar/v4 v4.9.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
4343
github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4=
4444
github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs=
45-
github.com/bufbuild/protocompile v0.14.2-0.20251112213711-9afd4296dfe2 h1:PpGm1S0XcJuNCrbwlktT1pM4hTgu6n0Gdsw5diq6p6k=
46-
github.com/bufbuild/protocompile v0.14.2-0.20251112213711-9afd4296dfe2/go.mod h1:HKN246DRQwavs64sr2xYmSL+RFOFxmLti+WGCZ2jh9U=
45+
github.com/bufbuild/protocompile v0.14.2-0.20251120233202-3f9009bcd6c8 h1:l4PKzJ7Usff8j5/e+YaWZPaM+rJHIghgDxRn8vDNxNo=
46+
github.com/bufbuild/protocompile v0.14.2-0.20251120233202-3f9009bcd6c8/go.mod h1:HKN246DRQwavs64sr2xYmSL+RFOFxmLti+WGCZ2jh9U=
4747
github.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1 h1:V1xulAoqLqVg44rY97xOR+mQpD2N+GzhMHVwJ030WEU=
4848
github.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1/go.mod h1:c5D8gWRIZ2HLWO3gXYTtUfw/hbJyD8xikv2ooPxnklQ=
4949
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=

private/buf/buflsp/file.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func (f *file) IndexSymbols(ctx context.Context) {
321321
for _, sym := range unresolved {
322322
switch kind := sym.kind.(type) {
323323
case *reference:
324-
def := f.resolveASTDefinition(ctx, kind.def, kind.fullName)
324+
def := f.resolveASTDefinition(kind.def, kind.fullName)
325325
sym.def = def
326326
if def == nil {
327327
// In the case where the symbol is not resolved, we continue
@@ -339,7 +339,7 @@ func (f *file) IndexSymbols(ctx context.Context) {
339339
}
340340
referenceable.references = append(referenceable.references, sym)
341341
case *option:
342-
def := f.resolveASTDefinition(ctx, kind.def, kind.defFullName)
342+
def := f.resolveASTDefinition(kind.def, kind.defFullName)
343343
sym.def = def
344344
if def != nil {
345345
referenceable, ok := def.kind.(*referenceable)
@@ -354,7 +354,7 @@ func (f *file) IndexSymbols(ctx context.Context) {
354354
referenceable.references = append(referenceable.references, sym)
355355
}
356356
}
357-
typeDef := f.resolveASTDefinition(ctx, kind.typeDef, kind.typeDefFullName)
357+
typeDef := f.resolveASTDefinition(kind.typeDef, kind.typeDefFullName)
358358
sym.typeDef = typeDef
359359
default:
360360
// This shouldn't happen, logging a warning
@@ -756,9 +756,9 @@ func (f *file) messageToSymbolsHelper(msg ir.MessageValue, index int, parents []
756756

757757
// resolveASTDefinition is a helper for resolving the [ast.DeclDef] to the *[symbol], if
758758
// there is a matching indexed *[symbol].
759-
func (f *file) resolveASTDefinition(ctx context.Context, def ast.DeclDef, defName ir.FullName) *symbol {
759+
func (f *file) resolveASTDefinition(def ast.DeclDef, defName ir.FullName) *symbol {
760760
// First check if the definition is in the current file.
761-
if def.Span().Path() == f.objectInfo.LocalPath() {
761+
if def.Span().Path() == f.file.Path() {
762762
return f.referenceableSymbols[defName]
763763
}
764764
// No workspace, we cannot resolve the AST definition from outside of the file.

0 commit comments

Comments
 (0)