dotnet / dotnet/vscode-csharp

Quick info on `AnonymousType`'s `new` and property is strange

Open
#6,672 1 comment 0 reactions 1 assignee Claimed by @dibarbet View on GitHub
Bug Triaged
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

Type: Bug

## Issue Description ##

![quick info of the new keyword](https://github.com/dotnet/vscode-csharp/assets/56380096/2fb1c0dd-307d-4e23-ab61-7f6a63d20294)

The color of `a` is red and it only has an openinig quotation mark.

![quick info of the EventType](https://github.com/dotnet/vscode-csharp/assets/56380096/f1b4ccd7-f4ed-42c6-91fe-db17ac75fdad)

The color of `}` is red and it only has an openinig quotation mark.

## Steps to Reproduce ##

```csharp
static void Hello()
{
Debug.Log(new { EventType = "load" });
}
```

Hover over the `new` keyword and the property `EventType`.

## Expected Behavior ##

No red text is shown. Quotation marks are complete.

## Actual Behavior ##

- The color of `a` is red and it only has an openinig quotation mark.
- The color of `}` is red and it only has an openinig quotation mark.

## Logs ##


### C# log ###
Post the output from Output-->C# here

### C# LSP Trace Logs ###
Post the output from Output-->C# LSP Trace Logs here. Requires `dotnet.server.trace` to be set to `Trace`

## Environment information ##

**VSCode version**: 1.84.2
**C# Extension**: 2.10.28
**Using OmniSharp**: false

Dotnet Information
.NET SDK:
Version: 7.0.304
Commit: 7e794e2806

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.304\

Host:
Version: 7.0.7
Architecture: x64
Commit: 5b20af47d9

.NET SDKs installed:
7.0.202 [C:\Program Files\dotnet\sdk]
7.0.304 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Visual Studio Code Extensions

|Extension|Author|Version|Folder Name|
|---|---|---|---|
|csdevkit|ms-dotnettools|1.0.14|ms-dotnettools.csdevkit-1.0.14-win32-x64|
|csharp|ms-dotnettools|2.10.28|ms-dotnettools.csharp-2.10.28-win32-x64|
|docomment|k--kato|1.0.0|k--kato.docomment-1.0.0|
|es7-react-js-snippets|dsznajder|4.4.3|dsznajder.es7-react-js-snippets-4.4.3|
|gitlens|eamodio|14.5.0|eamodio.gitlens-14.5.0|
|material-icon-theme|PKief|4.31.0|pkief.material-icon-theme-4.31.0|
|phind|phind|0.16.0|phind.phind-0.16.0|
|prettier-vscode|esbenp|10.1.0|esbenp.prettier-vscode-10.1.0|
|remote-containers|ms-vscode-remote|0.321.0|ms-vscode-remote.remote-containers-0.321.0|
|remote-explorer|ms-vscode|0.4.1|ms-vscode.remote-explorer-0.4.1|
|remote-server|ms-vscode|1.5.0|ms-vscode.remote-server-1.5.0|
|remote-ssh|ms-vscode-remote|0.107.0|ms-vscode-remote.remote-ssh-0.107.0|
|remote-ssh-edit|ms-vscode-remote|0.86.0|ms-vscode-remote.remote-ssh-edit-0.86.0|
|remote-wsl|ms-vscode-remote|0.81.8|ms-vscode-remote.remote-wsl-0.81.8|
|vs-code-prettier-eslint|rvest|5.1.0|rvest.vs-code-prettier-eslint-5.1.0|
|vscode-docker|ms-azuretools|1.28.0|ms-azuretools.vscode-docker-1.28.0|
|vscode-dotnet-runtime|ms-dotnettools|2.0.0|ms-dotnettools.vscode-dotnet-runtime-2.0.0|
|vscode-eslint|dbaeumer|2.4.2|dbaeumer.vscode-eslint-2.4.2|
|vscode-pull-request-github|GitHub|0.76.1|github.vscode-pull-request-github-0.76.1|
|vscode-remote-extensionpack|ms-vscode-remote|0.24.0|ms-vscode-remote.vscode-remote-extensionpack-0.24.0|
|vscode-tailwindcss|bradlc|0.10.3|bradlc.vscode-tailwindcss-0.10.3|
|vscode-thunder-client|rangav|2.15.3|rangav.vscode-thunder-client-2.15.3|
|vscodeintellicode-csharp|ms-dotnettools|0.1.26|ms-dotnettools.vscodeintellicode-csharp-0.1.26-win32-x64|
|vsliveshare|ms-vsliveshare|1.0.5892|ms-vsliveshare.vsliveshare-1.0.5892|
|vstuc|visualstudiotoolsforunity|0.9.3|visualstudiotoolsforunity.vstuc-0.9.3|;

Extension version: 2.10.28
VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z)
OS version: Windows_NT x64 10.0.22621
Modes:

System Info

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx (8 x 2096)|
|GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|14.94GB (5.40GB free)|
|Process Argv|--folder-uri file:///d%3A/GameDev/Projects/xiaohai-land --crash-reporter-id 5ec897fd-074c-40eb-ac47-075f83b0f60b|
|Screen Reader|no|
|VM|0%|

A/B Experiments

```
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30880072
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
282f8724:30602487
f6dab269:30613381
2i9eh265:30646982
showlangstatbar:30737416
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialogc:30887144
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30869155
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixt:30871694
pythonregdiag2:30871582
pyreplss1:30886140
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:30885897
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016cf:30886111
dsvsc017:30886112
dsvsc018cf:30886115
aa_t_chat:30882232

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.