microsoft / microsoft/TypeScript

Add semantic highlighting type for **aliased** import types in JS/TS

オープン
#42,918 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Awaiting More Feedback Suggestion
主要言語
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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まずセマンティックハイライトとセマンティックトークンのドキュメントを読み、次に encodedSemanticClassifications に関連するコードを追ってください。この issue の import の例を使って、エイリアス名がどのように表現されるかを確認してください。通常の import された型を変更せずに、エイリアス付きの import 識別子が異なるセマンティックハイライトの型を受け取れるようになれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, typescript
領域
compilers, devtools
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。