microsoft / microsoft/TypeScript
Add semantic highlighting type for **aliased** import types in JS/TS
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia leggendo la documentazione sull'evidenziazione semantica e sui token semantici, quindi segui il codice relativo a encodedSemanticClassifications. Usa gli esempi di importazione in questa issue per determinare come vengono rappresentati i nomi con alias. Il lavoro è completato quando gli identificatori delle importazioni con alias possono ricevere un tipo di evidenziazione semantica distinto senza modificare i normali tipi importati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, typescript
- Ambito
- compilers, devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100