Repository navigation
Conversation
Go-to-definition found nothing for an enum value written as an option's
value, such as option (my.level) = LEVEL_HIGH; or {level: LEVEL_HIGH} in
a message literal: an option's keys get symbols, its values don't. Give
an enum value a reference symbol to its declaration, and index enum
values among the symbols a reference resolves to, as their names are
static symbols.
References and rename of enum values are unchanged: enum values are
static symbols, which they don't handle.
This branch has not been deployed
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.
Fixes #4808.
Go-to-definition found nothing for an enum value written as an option's
value, such as
option (my.level) = LEVEL_HIGH;or{level: LEVEL_HIGH}in a message literal, while it works for the option's name and the
literal's keys.
messageToSymbolsHelper, an element whose value is an enum valuegets a
referencesymbol to that value's declaration, as a type namedoes.
names are
staticsymbols, which that index left out.Tests:
TestDefinitionOptionEnumValue: go-to-definition on an enum value asan option's value and inside a message literal, and, as a control, on
the option's name. Both enum-value cases fail without the change and
pass with it.
go test ./private/buf/buflsp/passes.Not changed: references and rename of enum values. They handle
referenceablesymbols only, and enum values staystatic, soreferences from an enum value's declaration still don't find its uses
in options. Making enum values referenceable would change their
highlighting and rename everywhere; happy to follow up if you want that.
A CHANGELOG entry is included under Unreleased.