microsoft / microsoft/TypeScript
Async LanguageServiceHost
オープン
まだ誰も着手していません。
Domain: API
In Discussion
Suggestion
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Search Terms
language, service, host, async, api
Suggestion
It'd super awesome if Language Service would accept a LanguageServiceHost with async API
Use Cases
Using LanguageService in environments where readFileSync is not available like browsers (using browserfs package or fs provided by WebSockets)
I'm working on an app like CodeSandbox but a bit more sophisticated.
Examples
class Host implements ts.LanguageServiceHost {
async getScriptSnapshot(filename: string): Promise<ts.IScriptSnapshot> { }
async readFile(filename: string): Promise<string> {}
}
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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
issue で説明されている LanguageServiceHost API と LanguageService API から始め、現在の同期的な前提を、非同期の getScriptSnapshot と readFile の例と比較します。readFileSync を利用できないブラウザー環境に必要な API 設計を決定します。非同期ホストを使用しても既存の TypeScript または JavaScript コードを壊さずに済めば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100