Skip to content

fix(ast): preserve TS index signature name span instead of discarding#23656

Draft
camchenry wants to merge 1 commit into
mainfrom
06-19-fix_ast_preserve_ts_index_signature_name_span_instead_of_discarding
Draft

fix(ast): preserve TS index signature name span instead of discarding#23656
camchenry wants to merge 1 commit into
mainfrom
06-19-fix_ast_preserve_ts_index_signature_name_span_instead_of_discarding

Conversation

@camchenry

@camchenry camchenry commented Jun 20, 2026

Copy link
Copy Markdown
Member

Doing some downstream work in https://github.com/camchenry/oxc_checker, I noticed that the span for TSIndexSignatureName refers to the entire foo: 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 with tsc, 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 Str to an actual IdentifierName, which means we store both the Str and the Span for the name. There is a custom ESTree converter added so that we don't change the existing ESTree output however.

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of 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.

@camchenry camchenry force-pushed the 06-19-fix_ast_preserve_ts_index_signature_name_span_instead_of_discarding branch from 6832c0b to 1ce1284 Compare June 20, 2026 03:13
@github-actions github-actions Bot added A-linter Area - Linter A-parser Area - Parser A-cli Area - CLI A-minifier Area - Minifier A-ast Area - AST A-codegen Area - Code Generation A-formatter Area - Formatter A-linter-plugins Area - Linter JS plugins labels Jun 20, 2026
@codspeed-hq

codspeed-hq Bot commented Jun 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing 06-19-fix_ast_preserve_ts_index_signature_name_span_instead_of_discarding (7b82c04) with main (b1948a1)

Open in CodSpeed

Footnotes

  1. 9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camchenry camchenry force-pushed the 06-19-fix_ast_preserve_ts_index_signature_name_span_instead_of_discarding branch from 1ce1284 to 1131771 Compare June 20, 2026 03:24
@camchenry camchenry force-pushed the 06-19-fix_ast_preserve_ts_index_signature_name_span_instead_of_discarding branch from 1131771 to 7b82c04 Compare June 20, 2026 03:45
@github-actions github-actions Bot added the A-ast-tools Area - AST tools label Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-ast-tools Area - AST tools A-cli Area - CLI A-codegen Area - Code Generation A-formatter Area - Formatter A-linter Area - Linter A-linter-plugins Area - Linter JS plugins A-minifier Area - Minifier A-parser Area - Parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant