fix(ast): preserve TS index signature name span instead of discarding#23656
fix(ast): preserve TS index signature name span instead of discarding#23656camchenry wants to merge 1 commit into
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
6832c0b to
1ce1284
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
1ce1284 to
1131771
Compare
1131771 to
7b82c04
Compare

Doing some downstream work in https://github.com/camchenry/oxc_checker, I noticed that the span for
TSIndexSignatureNamerefers to the entirefoo: string, but there's no subspan for the name specifically, even though we do parse this information. See camchenry/oxc_checker@e2105ae for how I'm working around this instead. (This makes it difficult to compare types withtsc, since it has a type for this location, but that's beside the point)So, this PR changes the type for the name from just plain
Strto an actualIdentifierName, which means we store both theStrand theSpanfor the name. There is a custom ESTree converter added so that we don't change the existing ESTree output however.