Use negative UninterpretedOption field tags for interpreted option locations. - #29005
Draft
copybara-service[bot] wants to merge 1 commit into
Draft
Use negative UninterpretedOption field tags for interpreted option locations.#29005copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_958626527
branch
2 times, most recently
from
August 4, 2026 19:19
7ef1684 to
1a099ba
Compare
…cations. This allows us to extend improved SourceCodeInfo support to dot-notation options without breaking backwards compatibility. Dot-notation options like `(my_opt).a = 123` already emit SourceCodeInfo location in a form of `[..., 10101, 1]` where 1 is the tag of field `a`. That location spans the whole option. But these pre-existing locations are limited as they don't provide granular information about each part of the option (e.g. location of `a`) and don't provide location for value too. Using negative values allows us to create non-overlapping set of locations. For example in the example above we will emit (in future CL): [..., 10101] - location of the whole `(my_opt).a = 123` option [..., 10101, 1] - legacy duplicate location of the whole `(my_opt).a = 123` option [..., 10101, -2] - location of `(my_opt)` part [..., 10101, -8, 1, -2] - location of `a` part [..., 10101, -8, 1, -4] - location of `123` part PiperOrigin-RevId: 958626527
copybara-service
Bot
force-pushed
the
test_958626527
branch
from
August 4, 2026 19:42
1a099ba to
563f0ce
Compare
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.
Use negative UninterpretedOption field tags for interpreted option locations.
This allows us to extend improved SourceCodeInfo support to dot-notation options without breaking backwards compatibility. Dot-notation options like
(my_opt).a = 123already emit SourceCodeInfo location in a form of[..., 10101, 1]where 1 is the tag of fielda. That location spans the whole option. But these pre-existing locations are limited as they don't provide granular information about each part of the option (e.g. location ofa) and don't provide location for value too.Using negative values allows us to create non-overlapping set of locations. For example in the example above we will emit (in future CL):
[..., 10101] - location of the whole
(my_opt).a = 123option[..., 10101, 1] - legacy duplicate location of the whole
(my_opt).a = 123option[..., 10101, -2] - location of
(my_opt)part[..., 10101, -8, 1, -2] - location of
apart[..., 10101, -8, 1, -4] - location of
123part