Open
Description
While working on PR #3873 for #3109 I noticed the following errors when applying the original code fix for SA1402 for two edge cases.
If there are no using statements then a space is added between the namespace and the class in the new file:
namespace TestNamespace
{
public class TestClass
{
public int MyProperty { get; set; }
}
public class TestClass2
{
public string MyProperty { get; set; }
}
}
New File:
namespace TestNamespace
{
public class TestClass2
{
public string MyProperty { get; set; }
}
}
Similarly if there is a preprocessor directive with using statements then a space is added between the last using statement and the ending directive:
namespace TestNamespace
{
#if true
using System;
#endif
public class TestClass
{
public DateTime MyDate { get; set; }
}
public class TestClass2
{
public DateTime MyDate2 { get; set; }
}
}
New File:
namespace TestNamespace
{
#if true
using System;
#endif
public class TestClass2
{
public DateTime MyDate2 { get; set; }
}
}
Metadata
Metadata
Assignees
Labels
No labels