Open jbevain opened 5 years ago
@jaredpar This is a compiler bug: the compiler should not report CS8019 when one or more identifiers fails to bind during semantic analysis.
CC @gafter pretty sure this has been discussed before and there are good reasons for why we do this. Or possibly bad ones we just can't reasonably fix.
The problem is not going to be limited to identifier binding errors. If the compiler emits pretty much any other error you should not be removing unused namespaces. Any fix to the error is likely to reveal other namespaces that are in use.
Version Used:
Steps to Reproduce:
test.cs
.test.cs
test.cs
file in Visual Studio as a standalone C# file outside of a project.Expected Behavior:
File is formatted to my settings, for example:
Actual Behavior:
File is formatted to my settings, but removes the using statements. For instance:
Opening a standalone C# file outside of a project prevents us to know all the references the file needs. If we're reformatting a standalone C# file we probably shouldn't perform cleanups that are potentially destructive.