Open Skyedra opened 4 years ago
I am not sure if c# extension can fix this on its own. Maybe this would be enough? https://github.com/microsoft/vscode/issues/77214
As a workaround to stop reporting errors from the build task, you could update your tasks.json such that the "build" task doesn't define a problemMatcher.
example:
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/dotnet-format.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
- "problemMatcher": "$msCompile"
+ "problemMatcher": []
},
Issue Description
If the last time you compiled there was a programming error, you will continue to observe the red underline indicating an error until you compile again. This is inconsistent behavior with the real-time detection between compiles, and leads to a confusing state.
The phantom error will also remain in the 'problems' window and file sidebar until recompile, even if fixed. After a recompile, the error is removed from both 'problems' and intellisense.
The incorrect underline persists if omnisharp is restarted, as well as if the file is closed and re-opened. However, if VS Code window is reloaded, the stale underline goes away.
Comparatively, Intellisense red underlines work normally for errors that are introduced and fixed between compiles. (Automatic flag & unflag of error in real-time). It's not until the error is compiled that it becomes persistent until the next compile.
Steps to Reproduce
Expected Behavior
Intellisense red underlines reflects the current, real-time state of the code.
Actual Behavior
Intellisense red underlines reflects an inconsistent state -- combining the errors (but not fixes) of the previous compile attempt plus additional any errors introduced since then. Since the errors update elsewhere, the developer expects the errors shown to be the current state of the code, and then spends time chasing after errors that are already fixed.
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.46.1 C# Extension: 1.22.1
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.301 Commit: 7feb845744 Runtime Environment: OS Name: ubuntu OS Version: 18.04 OS Platform: Linux RID: ubuntu.18.04-x64 Base Path: /usr/share/dotnet/sdk/3.1.301/ Host (useful for support): Version: 3.1.5 Commit: 65cd789777 .NET Core SDKs installed: 2.1.807 [/usr/share/dotnet/sdk] 3.1.301 [/usr/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.19 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.19 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.19 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |codedox|wiggin77|1.3.1| |csharp|ms-dotnettools|1.22.1| |haxe-debug|vshaxe|1.2.3| |haxe-extension-pack|vshaxe|1.3.0| |haxe-hl|HaxeFoundation|1.1.0| |hxcpp-debugger|vshaxe|1.2.4| |svn-scm|johnstoncode|2.11.4| |vshaxe|nadako|2.21.2|;