Skip to content

Add method to ir.Value to check if it is from a top-level option declaration#687

Merged
doriable merged 4 commits intomainfrom
fix-options-source-locations
Mar 18, 2026
Merged

Add method to ir.Value to check if it is from a top-level option declaration#687
doriable merged 4 commits intomainfrom
fix-options-source-locations

Conversation

@doriable
Copy link
Member

@doriable doriable commented Mar 18, 2026

This PR adds a method to ir.Value to check whether it
is from a top-level option declaration for source.

This allows us to fix an issue in the file descriptor generator,
where we need to determine whether a message option value
corresponds with a top-level option declaration in source.

This also adds a DescriptorOption to generate additional locations
for the elements within the option message literals, similar to the old
SourceInfoMode = SourceInfoExtraOptionLocations.

@doriable doriable requested a review from mcy March 18, 2026 20:16
@doriable doriable merged commit 4f2a439 into main Mar 18, 2026
6 checks passed
@doriable doriable deleted the fix-options-source-locations branch March 18, 2026 22:21
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.

2 participants