microsoft / microsoft/TypeScript
Please document compiler APIs
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Would it be possible to get some documentation on the compiler APIs?
I am working on some TypeScript tooling, and I am using ts.createSourceFile() to get the AST for a TypeScript source file. However, the tree in SourceFile.statements is missing some information. For example, I need to know the type of an Expression when a PropertyDeclaration only has an initializer but no declared type. I have tried TypeChecker.getContextualType() but it always returns undefined; also the implementation doesn't look right. There are internal methods like TypeChecker.getTypeOfExpression() that look promising, but they are not visible. Also I read some mention of 'bindings', but I haven't found a way to get them.
Another example is type resolution: When I encounter a TypeNode or something similar within the AST, I usually need to know about its declaration: Where does it come from? Is it local? Where is it imported from? Of course I can write that myself with some effort, but surely such logic already exists within the compiler, I just don't know where.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、issue で挙げられているコンパイラ API の領域を確認します: ts.createSourceFile()、SourceFile.statements、TypeChecker.getContextualType()、getTypeOfExpression()、bindings、型解決。式の型と宣言を取得するためにサポートされている公開 API を、imports とローカル宣言の識別方法を含めて文書化します。これらのワークフローが TypeScript ツールの作者向けに明確に説明されていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers, documentation
- issue の種類
- ドキュメント
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 20/100