Repository navigation
fix: TypeScript の型引数内の typeof import を解析する - #39
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
有効な TypeScript / TSX の
importOriginal<typeof import("node:fs")>()が型引数内で parse error となり、後続のオブジェクトメソッドの構造まで崩れる問題を修正します。共有文法のcall_expressionと_type_query_call_expressionの1組を静的な優先順位から実行時の衝突へ移し、型引数内の import type query を解析できるようにします。別の型注釈用の優先順位は維持します。配布 crate 0.23.2 を基準に TS / TSX 文法を vendor 化し、ABI 14 で両方の C パーサーを再生成しました。ライセンス・配布物のチェックサム・生成ツールと npm 依存の固定・再生成手順を
vendor/tree-sitter-typescript/PATCHES.mdに記録しています。通常の Cargo ビルドに npm や文法生成器は不要です。ローカルで新規単体11件・CLI5件と既存の関連65件、合計81件が通過しました(ignored 0)。パッケージ単体の文法ロード2件、fmt、default all-targets Clippy、差分の空白検査、影響分析、独立レビューも通過しています。修正前は TS / TSX の両方で報告どおり ERROR at 1:63 を再現しました。元 crate、無修正再生成、修正後を比べ、上流コーパス各112件の全 AST が一致しています。比較式・動的 import・ジェネリック呼び出し・optional call・JSX などの対照も確認しています。
既存の文法では、裸の
await call<Item>()による callee 抽出とジェネリックなタグ付きテンプレートに制約があります。今回の変更前から存在する挙動で、元パーサーとの AST 対照と文書に記録しています。直接呼び出しとawait (call<Item>())では callee の抽出を検証します。Closes #33