1.4K Star 7.6K Fork 1.4K

GVP方舟编译器 / OpenArkCompiler

 / 详情

TypeScript TI API FindDecl and IsCppField to work with imported elements.

已完成
成员
创建于  
2021-12-23 09:56

Need mHandler->FindDecl and mHandler->IsCppField to support imported elements from other TypeScript modules.

  1. 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

  2. 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);
Image description
$ cat type-only-export.ts -n
1 class Klass {
2 n: number = 0;
3 }
4 export type K = Klass;
Image description

评论 (2)

eching 创建了任务
HuWen 添加了
 
MapleFE
标签
展开全部操作日志

fixed typeidx of imported node

Image description

Image description

fixed 2) as well

============== Direct Field NodeIds ==============
 15 17 11 12
HuWen 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
5275110 hu   wen 1581627339
C++
1
https://gitee.com/openarkcompiler/OpenArkCompiler.git
git@gitee.com:openarkcompiler/OpenArkCompiler.git
openarkcompiler
OpenArkCompiler
OpenArkCompiler

搜索帮助

53164aa7 5694891 3bd8fe86 5694891