dotnet / dotnet/csharp-tmLanguage

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

Open
#332 7 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
78
Forks
43
Avg merge
34m
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.