Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick info on AnonymousType's new and property is strange #6672

Open
xiaohai-huang opened this issue Nov 14, 2023 · 1 comment
Open

Quick info on AnonymousType's new and property is strange #6672

xiaohai-huang opened this issue Nov 14, 2023 · 1 comment
Assignees
Milestone

Comments

@xiaohai-huang
Copy link

xiaohai-huang commented Nov 14, 2023

Type: Bug

Issue Description

quick info of the new keyword

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

quick info of the EventType

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

Steps to Reproduce

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

@dibarbet
Copy link
Member

dibarbet commented Nov 16, 2023

The ' before the a is intentional, thats how we display anonymous type names in VS as well. The coloring is coming from the C# textmate grammar. I believe it thinks the ' is an unclosed string, hence the red coloring on the a and the } in your second example.

We unfortunately don't have a lot of control over the colorization here - we mark code blocks and it colors. However we may be able to make some adjustments (potentially removing the ' for VSCode) to try and get a little better colorization.

Related to #6678

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants