dotnet / dotnet/csharp-tmLanguage

C# syntax highlighting broken with collection expressions and string interpolation in method calls

Aperta
#332 7 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
78
Fork
43
Merge medio
34m
PR unite (30g)
1

Descrizione

Type: Bug

Description: the syntax highlighter incorrectly colors string interpolation when using collection expressions like string[] array = [...] followed by method calls with interpolated strings

``` csharp
Info(
$"Hello: '{thing}'",
$"Foo: {string.Join(", ", fooz)}",
$"Bar: {string.Join(", ", barz)}"
);
```
Image

___
the second comma ", ", betweens the params are orange
**_orange | orange_**
Image

im used to em like this
**_orange | white_**
Image

___

this is expected color of the comma thats a string and the comma that separates the parameters are different
``` csharp
string.Join(", ", fooz)
```
this is what getting both commas are the same color
``` csharp
$"Foo: {string.Join(", ", fooz)}",
```
___

so basically this is expected
**_blue | white_**
Image

this is what im getting
**blue | blue**
Image

Originally from @ezexe in https://github.com/microsoft/vscode/issues/255178

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia riproducendo l’esempio C# nella grammatica di sintassi csharp-tmLanguage e verifica come vengono tokenizzate le espressioni di raccolta, le stringhe interpolate e gli argomenti delle chiamate ai metodi. Il lavoro è completato quando la virgola all’interno di string.Join continua a essere formattata come contenuto della stringa, mentre la virgola che separa i parametri riceve il diverso colore previsto.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.