Open tillig opened 4 years ago
Seems this is a common problem where extensions aren't registering for the right events to handle file close/delete/rename. Enough that VS Code is going to add a 'clear' button to the Problems window. However, it'd still be nice if this extension would handle the events and clean up after itself on delete/rename of files.
This issue may be partially resolved when this PR merges https://github.com/OmniSharp/omnisharp-roslyn/pull/1694
Issue Description
If a Roslyn analyzer warning comes up for a file in VS Code (e.g., SA1649 from StyleCop - file name must match class name) and you rename the file, the issue remains in the "Problems" list in VS Code until you close the whole workspace and reopen it.
Steps to Reproduce
Foo.cs
.Bar
:Foo.cs
- "File name should match first type name. csharp(SA1649)"Bar.cs
- the file name now matches the type name.Foo.cs
remain.Foo.cs
. Don't do it.Foo.cs
remain.Expected Behavior
After renaming the
Foo.cs
file I expect the warnings/issues for that file to be removed from the "Problems" window. If analysis finds new warnings in the renamed file, those should appear.Actual Behavior
After renaming the
Foo.cs
file the warnings/issues forFoo.cs
remain in the "Problems" window until you close VS Code and reopen it.Logs
OmniSharp log
There don't appear to be relevant logs for this issue, though I do see a lot of messages like this:
I find that odd because a lot of the skipped fixes appear to be things I'd expect to be supported in C#, though perhaps these are the VB equivalents.
C# log
There is not a single log line in the C# output window.
Environment information
VSCode version: 1.41.1 C# Extension: 1.21.9
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.100 Commit: cd82f021f4 Runtime Environment: OS Name: Mac OS X OS Version: 10.15 OS Platform: Darwin RID: osx.10.15-x64 Base Path: /usr/local/share/dotnet/sdk/3.1.100/ Host (useful for support): Version: 3.1.0 Commit: 65f04fb6db .NET Core SDKs installed: 2.1.607 [/usr/local/share/dotnet/sdk] 3.1.100 [/usr/local/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.0 [/usr/local/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| |---|---|---| |auto-close-tag|formulahendry|0.5.6| |auto-rename-tag|formulahendry|0.1.1| |azure-account|ms-vscode|0.8.7| |azurerm-vscode-tools|msazurermtools|0.8.3| |beautify|HookyQR|1.5.0| |code-runner|formulahendry|0.9.15| |code-settings-sync|Shan|3.4.3| |color-info|bierner|0.5.1| |cpptools|ms-vscode|0.26.2| |csharp|ms-vscode|1.21.9| |debugger-for-chrome|msjsdiag|4.12.3| |dotenv|mikestead|1.0.1| |dotnet-test-explorer|formulahendry|0.7.1| |ecdc|mitchdenny|1.3.0| |EditorConfig|EditorConfig|0.14.4| |gitlens|eamodio|10.2.0| |Go|ms-vscode|0.11.9| |guides|spywhere|0.9.3| |html-css-class-completion|Zignd|1.19.0| |java|redhat|0.54.2| |markdown-preview-enhanced|shd101wyy|0.5.0| |material-theme|zhuangtongfa|3.2.1| |msbuild-project-tools|tintoy|0.3.2| |mssql|ms-mssql|1.8.0| |nc-gcode|ML|0.13.0| |ng-template|Angular|0.900.3| |npm-intellisense|christian-kohler|1.3.0| |output-colorizer|IBM|0.1.2| |path-intellisense|christian-kohler|1.4.2| |polacode|pnp|0.3.4| |powershell|ms-vscode|2019.12.0| |python|ms-python|2019.11.50794| |remote-wsl|ms-vscode-remote|0.41.6| |restructuredtext|lextudio|116.0.0| |rewrap|stkb|1.9.1| |sort-lines|Tyriar|1.9.0| |sublime-keybindings|ms-vscode|4.0.6| |terraform|mauve|1.4.0| |todo-tree|Gruntfuggly|0.0.162| |vscode-aks-tools|ms-kubernetes-tools|0.0.4| |vscode-arduino|vsciot-vscode|0.2.28| |vscode-docker|ms-azuretools|0.9.0| |vscode-eslint|dbaeumer|2.0.11| |vscode-icons|vscode-icons-team|9.6.0| |vscode-java-debug|vscjava|0.23.0| |vscode-java-dependency|vscjava|0.6.0| |vscode-java-pack|vscjava|0.8.1| |vscode-java-test|vscjava|0.22.0| |vscode-json-stable-stringify|TravisIllig|1.1.0| |vscode-kubernetes-tools|ms-kubernetes-tools|1.0.9| |vscode-markdownlint|DavidAnson|0.33.0| |vscode-maven|vscjava|0.20.1| |vscode-npm-script|eg2|0.3.10| |vscode-typescript-tslint-plugin|ms-vscode|1.2.3| |vscode-yaml|redhat|0.6.1| |vscodeintellicode|VisualStudioExptTeam|1.2.2| |xml|DotJoshJohnson|2.5.0|;