Skip to content

Resolve the extendee of an extend block in the LSP - #4811

Merged
pkwarren merged 4 commits into
bufbuild:mainfrom
douzebis:lsp-extendee
Dec 2, 2026
Merged

pkwarren merged 4 commits into
bufbuild:mainfrom
douzebis:lsp-extendee

Conversation

@douzebis

@douzebis douzebis commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Go-to-definition on the message named in an extend block found nothing. For example, nothing happened on FieldOptions in:

extend google.protobuf.FieldOptions {
  optional string tag = 50000;
}

References from that message's declaration also left out its extend blocks.

An extension's symbol spans only the extension's own name, so nothing spanned the extended message. Each extend block, including ones nested in messages, now indexes the extended message's name as a reference to its declaration, like a field's type.

Not covered: renaming a message replaces a qualified name such as extend other.v1.Base with just the new name, which drops the package. Qualified field types already have the same problem, so it needs a separate fix in rename.

Fixes #4810.

Go-to-definition on the message an extend block extends, such as
google.protobuf.FieldOptions in extend google.protobuf.FieldOptions,
found nothing, and that message's references didn't include its extend
blocks: an extension's symbol spans its own name, and nothing spanned
the extendee. Give each extend block, nested ones included, a reference
symbol to the extended message, as a field's type has.
Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
@emcfarlane
emcfarlane requested a review from pkwarren December 2, 2026 16:38
@pkwarren
pkwarren merged commit 80d469c into bufbuild:main Dec 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LSP: go-to-definition and references don't work for an extend block's extendee

3 participants