Need mHandler->FindDecl and mHandler->IsCppField to support imported elements from other TypeScript modules.
Currently in test case type-only-omport.ts, FindDecl on Identifier "K" (type-only-import.ts line 1, IdentifierNode at node 4 in AST) only returns the IdentifierNode for "K" (node 4) itself in type-only-import.ts. What is needed is a mechanism to get to its declaration in the module that exported it (type-only-export.ts line 1, ClassNode at node 20 in AST) the class node 20
IsCppField on IdentifierNode at node 12 in type-only-import.ts currently returns false. It should return true.
$ cat type-only-import.ts -n
1 import type { K } from "./type-only-export";
2
3 var x: K = { n: 123 };
4 console.log(x);
$ cat type-only-export.ts -n
1 class Klass {
2 n: number = 0;
3 }
4 export type K = Klass;
登录 后才可以发表评论