Put newline in front of all attribute lists
This commit is contained in:
Родитель
98b47ec5ae
Коммит
fdedaf854b
|
@ -9,6 +9,7 @@ using Microsoft.CodeAnalysis.Text;
|
|||
using Microsoft.CodeAnalysis.VisualBasic;
|
||||
using VbSyntax = Microsoft.CodeAnalysis.VisualBasic.Syntax;
|
||||
using CsSyntax = Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using SyntaxFactory = Microsoft.CodeAnalysis.VisualBasic.SyntaxFactory;
|
||||
|
||||
namespace ICSharpCode.CodeConverter.VB
|
||||
{
|
||||
|
@ -26,5 +27,12 @@ namespace ICSharpCode.CodeConverter.VB
|
|||
{
|
||||
return TriviaConverter.PortConvertedTrivia(node, _wrappedVisitor.Visit(node));
|
||||
}
|
||||
|
||||
public override VisualBasicSyntaxNode VisitAttributeList(CsSyntax.AttributeListSyntax node)
|
||||
{
|
||||
var convertedNode = _wrappedVisitor.Visit(node)
|
||||
.WithPrependedLeadingTrivia(SyntaxFactory.EndOfLineTrivia(Environment.NewLine));
|
||||
return TriviaConverter.PortConvertedTrivia(node, convertedNode);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -187,6 +187,21 @@ End Module");
|
|||
End Class");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestPropertyWithAttribute()
|
||||
{
|
||||
TestConversionCSharpToVisualBasic(
|
||||
@"class TestClass
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
int value { get; set; }
|
||||
}", @"Class TestClass
|
||||
<DatabaseGenerated(DatabaseGeneratedOption.None)>
|
||||
Private Property value As Integer
|
||||
End Class
|
||||
");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestConstructor()
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче