From 43f24116babe3ddc34cc64c03258829a188cda40 Mon Sep 17 00:00:00 2001 From: Bastiaan Marinus van de Weerd Date: Thu, 3 Apr 2025 11:34:14 -0300 Subject: [PATCH] Fix instantiation expr. args. in TypeScript. --- .../tree-sitter-stack-graphs-typescript/src/stack-graphs.tsg | 1 + .../test/expressions/instantiation.ts | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 languages/tree-sitter-stack-graphs-typescript/test/expressions/instantiation.ts diff --git a/languages/tree-sitter-stack-graphs-typescript/src/stack-graphs.tsg b/languages/tree-sitter-stack-graphs-typescript/src/stack-graphs.tsg index 773abde7c..fbc1a55a6 100644 --- a/languages/tree-sitter-stack-graphs-typescript/src/stack-graphs.tsg +++ b/languages/tree-sitter-stack-graphs-typescript/src/stack-graphs.tsg @@ -2678,6 +2678,7 @@ if none @is_async { (ternary_expression) (this) (true) + (instantiation_expression) ; #dialect typescript (type_assertion) ; #end diff --git a/languages/tree-sitter-stack-graphs-typescript/test/expressions/instantiation.ts b/languages/tree-sitter-stack-graphs-typescript/test/expressions/instantiation.ts new file mode 100644 index 000000000..65c217300 --- /dev/null +++ b/languages/tree-sitter-stack-graphs-typescript/test/expressions/instantiation.ts @@ -0,0 +1,4 @@ +function foo unknown>(x: T) {} +class Bar<_T> {} +foo(Bar); +// ^TODO defined: 2