Skip to content

fix: include string literal children in kind queries - #1689

Open
zanmlakar wants to merge 1 commit into
dsherret:latestfrom
zanmlakar:fix/string-literal-child-kind
Open

zanmlakar wants to merge 1 commit into
dsherret:latestfrom
zanmlakar:fix/string-literal-child-kind

Conversation

@zanmlakar

Copy link
Copy Markdown

Fixes #1632.

String literals in array elements and call arguments were skipped by getChildrenOfKind because the lookup treated StringLiteral as a token that needed direct token children. Search the parse tree for this kind so the child and first/last child getters find those literals, while preserving syntax-list lookup and descendant order.

Tests cover array elements, call arguments, syntax lists, first/last child getters, and nested descendants. Three focused regressions fail without the fix and pass with it. The final ts-morph suite passes with 4,388 tests and 2 pending on TypeScript 6.0.2. Project compile, code verification, formatting, and the Node bundle build pass.

The TypeScript-version matrix and Deno/browser builds were not run locally. The Deno-hosted setup build emitted its bundle but did not exit; the same package Rollup configuration completed successfully under Node.

No new dependencies or public signatures.

This branch has not been deployed

No deployments
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.

getChildrenOfKind does not work for StringLiteral

1 participant