microsoft / microsoft/TypeScript
Return export nodes of ast when resolving alias symbol
还没有人认领这个 Issue。
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.3k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 132
描述
Search Terms
export star node
Suggestion
Add an API which returns alias symbol of import specifier and the export nodes on the searching path.
Use Cases
I want to write a little tool to extract certain type in typescript code and its dependent types.
Current approaches just return the alias symbol, and it's difficult to establish relationship between import specifier and export star statements.
Examples
a.ts:
import {C} from './b';
b.ts:
export * from './c';
export * from './d';
export * from './e';
c.ts:
export const C = 1;
I want to get not only the location of symbol "C", but also the export star node in the AST of "b.ts", which is "export * from './c'".
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定任何文件、测试或编译器入口点。首先跟踪示例中的 import 所对应的别名符号和 export-star 声明是如何解析的;完成的标准是:某个 public API 返回搜索路径上的别名符号和 export 节点,同时不改变生成的 JavaScript。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- compilers
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100