@@ -137,11 +137,44 @@ public void TestMethod1(
137137 int z)
138138 {
139139 }
140+
141+ public void TestMethod2 (
142+ int x,
143+ int y,
144+ int z)
145+ {
146+ }
140147 }
141148}
142149" ;
143150
144- await VerifyCSharpDiagnosticAsync ( testCode , DiagnosticResult . EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
151+ var fixedTestCode = @"namespace TestNamespace
152+ {
153+ public class TestClass
154+ {
155+ public void TestMethod1(
156+ int x,
157+ int y,
158+ int z)
159+ {
160+ }
161+
162+ public void TestMethod2(
163+ int x,
164+ int y,
165+ int z)
166+ {
167+ }
168+ }
169+ }
170+ " ;
171+
172+ DiagnosticResult [ ] expectedDiagnostics =
173+ {
174+ Diagnostic ( DescriptorNotPreceded ) . WithLocation ( 12 , 33 ) ,
175+ } ;
176+
177+ await VerifyCSharpFixAsync ( testCode , expectedDiagnostics , fixedTestCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
145178 }
146179
147180 /// <summary>
@@ -781,6 +814,71 @@ public TestClass()
781814 await VerifyCSharpFixAsync ( testCode , expectedDiagnostics , fixedTestCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
782815 }
783816
817+ /// <summary>
818+ /// Verifies that spacing for multiline argument lists is handled properly.
819+ /// </summary>
820+ /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
821+ [ Fact ]
822+ public async Task TestMultiLineArgumentListAsync ( )
823+ {
824+ var testCode = @"using System;
825+
826+ namespace TestNamespace
827+ {
828+ public class TestClass
829+ {
830+ public TestClass(int x, int y)
831+ {
832+ var s1 = new String(
833+ 'a',
834+ x);
835+
836+ var s2 = new String (
837+ 'a',
838+ y);
839+
840+ // Opening parenthesis followed by space
841+ var s3 = new String(
842+ 'a',
843+ x);
844+ }
845+ }
846+ }
847+ " ;
848+
849+ var fixedTestCode = @"using System;
850+
851+ namespace TestNamespace
852+ {
853+ public class TestClass
854+ {
855+ public TestClass(int x, int y)
856+ {
857+ var s1 = new String(
858+ 'a',
859+ x);
860+
861+ var s2 = new String(
862+ 'a',
863+ y);
864+
865+ // Opening parenthesis followed by space
866+ var s3 = new String('a',
867+ x);
868+ }
869+ }
870+ }
871+ " ;
872+
873+ DiagnosticResult [ ] expectedDiagnostics =
874+ {
875+ Diagnostic ( DescriptorNotPreceded ) . WithLocation ( 13 , 33 ) ,
876+ Diagnostic ( DescriptorNotFollowed ) . WithLocation ( 18 , 32 ) ,
877+ } ;
878+
879+ await VerifyCSharpFixAsync ( testCode , expectedDiagnostics , fixedTestCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
880+ }
881+
784882 /// <summary>
785883 /// Verifies that spacing for while statements is handled properly.
786884 /// </summary>
0 commit comments