-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Closed
Copy link
Labels
Area-IDEConcept-Continuous ImprovementIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactoringshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
Version Used: Visual Studio 2019 Version 16.7.5
Steps to Reproduce:
- Write a following code, which has an
IDE0063 'using' statement can be simplified:
using System;
using System.IO;
class C
{
static void Main()
{
using (var s = new MemoryStream()) // foo
{ // bar
Console.WriteLine(s.CanRead); // Only this comment remains.
} // baz
}
}- Apply the
Use simple 'using' statement
Expected Behavior:
All comments remain like this:
using System;
using System.IO;
class C
{
static void Main()
{
using var s = new MemoryStream(); // foo
// bar
Console.WriteLine(s.CanRead); // Only this comment remains.
// baz
}
}Actual Behavior:
"foo", "bar", "baz" comments are deleted:
using System;
using System.IO;
class C
{
static void Main()
{
using var s = new MemoryStream();
Console.WriteLine(s.CanRead); // Only this comment remains.
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-IDEConcept-Continuous ImprovementIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactoringshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it