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
Microsoft Visual Studio Community 2017
Version 15.8.8
VisualStudio.15.Release/15.8.8+28010.2048
Microsoft .NET Framework
Version 4.7.03056
C# Tools 2.9.0-beta8-63208-01
Steps to Reproduce:
Set Visual Studio to perform additional cleanups during formatting.
Create a new standalone file test.cs.
Copy the following into test.cs
using System;using UnityEngine;using UnityEditor;classCamera:MonoBehaviour{publicvoidStart(){}publicvoidUpdate(){}}
Open the 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:
using System;using UnityEngine;using UnityEditor;classCamera:MonoBehaviour{publicvoidStart(){}publicvoidUpdate(){}}
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: