You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling a constructor to initialize a property using a non primitive type, the keyword new is not picked up and the constructor call is highlighted like a method call.
I already tried enabling csharp.semanticHighlighting.enabled and editor.semanticHighlighting.enabled which results in correct syntax highlighting for the constructor call but faulty highlighting for e.g. using directives.
Steps to Reproduce
Create new console app (dotnet new console)
Add non static method to Program
Add struct or object type property to Program
Initialize the property in the non static method
Expected Behavior
Syntax highlighting on the constructor call is the same as when calling the constructor for a local variable
Actual Behavior
Call to the constructor is highlighted like a method call
Logs
OmniSharp log
Post the output from Output-->Starting OmniSharp server at 8.5.2021, 20:45:40
Target: c:\Users\larsb\source\spielwiese\omnisharpHighlight
OmniSharp server started.
Path: c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8\OmniSharp.exe
PID: 13568
Starting OmniSharp on Windows 6.2.9200.0 (x64) info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.9.0 - "c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild\Current\Bin" info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to 'c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild\Current\Bin\MSBuild.exe' info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.9.0 - "c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild\Current\Bin"
CscToolExe = csc.exe
CscToolPath = c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild\Current\Bin\Roslyn
MSBuildExtensionsPath = c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild
MSBuildToolsPath = c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild\Current\Bin info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0 info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100 info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110 info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140 info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Users\larsb\source\spielwiese\omnisharpHighlight'. info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files info: OmniSharp.MSBuild.ProjectSystem
No solution files found in 'c:\Users\larsb\source\spielwiese\omnisharpHighlight' info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\larsb\source\spielwiese\omnisharpHighlight\omnisharpHighlight.csproj' info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Users\larsb\source\spielwiese\omnisharpHighlight'. info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files info: OmniSharp.WorkspaceInitializer
Configuration finished. info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\Users\larsb\source\spielwiese\omnisharpHighlight' on host 13500. info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\larsb\source\spielwiese\omnisharpHighlight\omnisharpHighlight.csproj info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'c:\Users\larsb\source\spielwiese\omnisharpHighlight\omnisharpHighlight.csproj'. info: OmniSharp.MSBuild.ProjectManager
Adding project 'c:\Users\larsb\source\spielwiese\omnisharpHighlight\omnisharpHighlight.csproj' info: OmniSharp.MSBuild.ProjectManager
Update project: omnisharpHighlight
Received response for /v2/getcodeactions but could not find request.
C# log
None
Environment information
VSCode version: 1.56.0 C# Extension: 1.23.11
Dotnet Information
.NET SDK (gem�� "global.json"):
Version: 5.0.100
Commit: 5044b93829
Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100\
Host (useful for support):
Version: 5.0.0
Commit: cf258a14b7
Issue Description
When calling a constructor to initialize a property using a non primitive type, the keyword
new
is not picked up and the constructor call is highlighted like a method call.I already tried enabling
csharp.semanticHighlighting.enabled
andeditor.semanticHighlighting.enabled
which results in correct syntax highlighting for the constructor call but faulty highlighting for e.g. using directives.Steps to Reproduce
dotnet new console
)Program
struct
orobject
type property toProgram
Expected Behavior
Syntax highlighting on the constructor call is the same as when calling the constructor for a local variable
Actual Behavior
Call to the constructor is highlighted like a method call
Logs
OmniSharp log
OmniSharp server started.
Path: c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8\OmniSharp.exe
PID: 13568
Starting OmniSharp on Windows 6.2.9200.0 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.9.0 - "c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild\Current\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to 'c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild\Current\Bin\MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.9.0 - "c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild\Current\Bin"
CscToolExe = csc.exe
CscToolPath = c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild\Current\Bin\Roslyn
MSBuildExtensionsPath = c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild
MSBuildToolsPath = c:\Users\larsb.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8.msbuild\Current\Bin
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Users\larsb\source\spielwiese\omnisharpHighlight'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in 'c:\Users\larsb\source\spielwiese\omnisharpHighlight'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\larsb\source\spielwiese\omnisharpHighlight\omnisharpHighlight.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Users\larsb\source\spielwiese\omnisharpHighlight'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\Users\larsb\source\spielwiese\omnisharpHighlight' on host 13500.
info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\larsb\source\spielwiese\omnisharpHighlight\omnisharpHighlight.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'c:\Users\larsb\source\spielwiese\omnisharpHighlight\omnisharpHighlight.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project 'c:\Users\larsb\source\spielwiese\omnisharpHighlight\omnisharpHighlight.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: omnisharpHighlight
Received response for /v2/getcodeactions but could not find request.
C# log
Environment information
VSCode version: 1.56.0
C# Extension: 1.23.11
Dotnet Information
.NET SDK (gem�� "global.json"): Version: 5.0.100 Commit: 5044b93829Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100\
Host (useful for support):
Version: 5.0.0
Commit: cf258a14b7
.NET SDKs installed:
5.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: