microsoft / microsoft/TypeScript-TmLanguage

Generic constructor with more than one generic type can break syntax highlighting.

Aperta
#973 4 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
TypeScript
Stelle
471
Fork
149
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

JavaScript and TypeScript Nightly version:

Last released - 4/4/2023, 02:09:37
Last updated - 4/4/2023, 18:09:42

Code

export class Foo {
    readonly bar = {
        map: new Map<
            Type1, Type2>([]) 
    };

    private function() {
        return 1;
    }
}

The code above breaks syntax highlighting, I have also tested in insiders vscode with nightly typescript.

image

It is fine, if both generics are on the same line as the main type:

image

If there is only 1 generic, it does slightly better, the highlighting of the generic is wrong, but the rest of the file is ok.

image

Or if the argument to the constructor is not a list, this it is also recoverable, although both the highlighting of the generic, and the closing angle bracket are wrong.

image

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Non è indicato alcun file sorgente o test. Inizia riproducendo l'esempio multilinea in TypeScript di un costruttore generico presente nell'issue, confrontalo con le varianti funzionanti e traccia la grammatica TypeScript TextMate responsabile dell'evidenziazione della sintassi. Il lavoro è concluso quando il codice mostrato e il file che lo circonda mantengono un'evidenziazione corretta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript, vscode
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.