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
Add some using statements, which are not used in the code
Expected Behavior
There should be a command to trigger "remove unnecessary usings" from the command palette, like "organize imports" command for typescript files.
There should also be a way to apply this to all C# files in a folder / project.
Ideally, there would be an option in the settings to have "remove unnecessary usings" run automatically when saving a C# fle.
Actual Behavior
Unused using statements are greyed out but cannot be removed from any location in the file.
I have to scroll up to the top of the file, position the cursor on one of the unused using statements, press Command+. (on a Mac) and select "remove unnecessary usings".
This is ridiculous because most of the time, the using statements are not even visible on screen when working on the code further down the file.
Logs
OmniSharp log
Post the output from Output-->OmniSharp log here
C# log
Post the output from Output-->C# here
Environment information
VSCode version: 1.37.1 C# Extension: 1.21.0
Mono Information
OmniSharp using global mono :6.0.0Dotnet Information
.NET Core SDK (gemäß "global.json"):
Version: 2.2.401
Commit: 729b316c13
Laufzeitumgebung:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx.10.14-x64
Base Path: /usr/local/share/dotnet/sdk/2.2.401/
Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51
@rchande there may be some overlap with #1179 but I was also asking/hoping for a command from command palette to trigger "remove unnecessary usings", as well as a preference setting to automatically trigger "remove unnecessary usings" when saving a file.
Also, from reading the comments I could not find the reason why #1179 was closed? The requested feature is not available (at least I haven't found it) but I also did not find any comment saying something like "we can't or won't implement that".
Issue Description
Steps to Reproduce
using
statements, which are not used in the codeExpected Behavior
There should be a command to trigger "remove unnecessary usings" from the command palette, like "organize imports" command for typescript files.
There should also be a way to apply this to all C# files in a folder / project.
Ideally, there would be an option in the settings to have "remove unnecessary usings" run automatically when saving a C# fle.
Actual Behavior
Unused using statements are greyed out but cannot be removed from any location in the file.
I have to scroll up to the top of the file, position the cursor on one of the unused using statements, press Command+. (on a Mac) and select "remove unnecessary usings".
This is ridiculous because most of the time, the using statements are not even visible on screen when working on the code further down the file.
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.37.1
C# Extension: 1.21.0
Mono Information
OmniSharp using global mono :6.0.0Dotnet Information
.NET Core SDK (gemäß "global.json"): Version: 2.2.401 Commit: 729b316c13Laufzeitumgebung:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx.10.14-x64
Base Path: /usr/local/share/dotnet/sdk/2.2.401/
Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51
.NET Core SDKs installed:
2.2.401 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: