microsoft / microsoft/TypeScript
Regex unicode property autocomplete
オープン
まだ誰も着手していません。
Awaiting More Feedback
Domain: LS: Completion Lists
Suggestion
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
🔍 Search Terms
regular expressions, unicode character class, unicode property, hints, autocomplete
✅ Viability Checklist
- 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, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
Since TS now validates regular expressions including unicode properties and even provides spelling suggestions, why not autocomplete them?
📃 Motivating Example
In this example TS 5.5 understands that the first regex is incorrect:
const re1 = /\p{Emoj}/u // Error: Unknown Unicode property name or value. Did you mean "Emoji"?
const re2 = /\p{Emoji}/u // Ok
💻 Use Cases
It would be convenient if TS suggested available unicode properties when suggestions are triggered inside \p{}/\P{} sequences.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ファイルもテストも指定されていません。まず、正規表現の Unicode プロパティ検証とスペル候補提案に関する TypeScript の既存のパスをたどり、次に \p{} と \P{} 内の補完要求がどこで処理されているかを見つけてください。両方の形式について焦点を絞ったテストを追加し、出力される JavaScript を変更せずに有効な Unicode プロパティが補完候補として提示されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers, developer-experience
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100