microsoft / microsoft/TypeScript

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

Offen
#42,918 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Awaiting More Feedback Suggestion
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.4k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem Lesen der Dokumentation zu semantischer Hervorhebung und semantischen Tokens und verfolge anschließend den Code im Zusammenhang mit encodedSemanticClassifications. Verwende die Importbeispiele in diesem Issue, um zu bestimmen, wie aliased names dargestellt werden. Als abgeschlossen gilt die Aufgabe, wenn Bezeichner aliased imports einen eigenen Typ für die semantische Hervorhebung erhalten können, ohne gewöhnliche importierte Typen zu ändern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, typescript
Bereich
compilers, devtools
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.