microsoft / microsoft/TypeScript
Add semantic highlighting type for **aliased** import types in JS/TS
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
TS Template added by @mjbvz
TypeScript Version: 4.1.5
Search Terms
- semantic highlight
- semantic tokens
- encodedSemanticClassifications
I feel it would be beneficial to be able to stylise aliases differently from normal types when using import as. A different style would allow the developer to see, at a glance, that the name is non-standard and has been modified in the local scope.
I often use aliases both for external libs and to disambiguate names from my local code (I use a folder/module namespacing method of file organisation for simplicity).
import { Formatter as RedisErrorFormatter } from 'lib/Redis/Client/Error/Formatter';
import { Client as RedisClient } from 'redis';
import { MongoClient } from 'mongodb';
// ...lots of code so imports are not visible...
RedisClient.registerFormatter(RedisErrorFormatter);
MongoClient.connect();
In the above example, RedisClient and RedisErrorFormatter would have the option to be highlighted differently, so that the fact that they were aliased is easy to recognise, without having to inspect the imports.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まずセマンティックハイライトとセマンティックトークンのドキュメントを読み、次に encodedSemanticClassifications に関連するコードを追ってください。この issue の import の例を使って、エイリアス名がどのように表現されるかを確認してください。通常の import された型を変更せずに、エイリアス付きの import 識別子が異なるセマンティックハイライトの型を受け取れるようになれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers, devtools
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100