Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
c1338281
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c1338281
编写于
11月 18, 2015
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove ConfigureAwait(true) from test code.
上级
5e31d025
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
315 addition
and
315 deletion
+315
-315
src/Workspaces/CSharpTest/Formatting/FormattingMultipleSpanTests.cs
...aces/CSharpTest/Formatting/FormattingMultipleSpanTests.cs
+8
-8
src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
+240
-240
src/Workspaces/CSharpTest/Formatting/FormattingTriviaTests.cs
...Workspaces/CSharpTest/Formatting/FormattingTriviaTests.cs
+67
-67
未找到文件。
src/Workspaces/CSharpTest/Formatting/FormattingMultipleSpanTests.cs
浏览文件 @
c1338281
...
...
@@ -24,13 +24,13 @@ public async Task EndOfLine()
var
content
=
@"namespace A{/*1*/}/*2*/"
;
var
expected
=
@"namespace A{}"
;
await
AssertFormatAsync
(
content
,
expected
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
expected
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
public
async
Task
Simple1
()
{
await
AssertFormatAsync
(
"namespace A/*1*/{}/*2*/ class A {}"
,
"namespace A{ } class A {}"
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
"namespace A/*1*/{}/*2*/ class A {}"
,
"namespace A{ } class A {}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -48,7 +48,7 @@ class A /*1*/{}/*2*/";
class A { }"
;
await
AssertFormatAsync
(
content
,
expected
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
expected
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -66,7 +66,7 @@ class A /*1*/{}/*2*/";
class A { }"
;
await
AssertFormatAsync
(
content
,
expected
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
expected
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -84,7 +84,7 @@ class A{}/*2*/";
class A { }"
;
await
AssertFormatAsync
(
content
,
expected
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
expected
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -102,7 +102,7 @@ class A{}/*2*/";
class A { }"
;
await
AssertFormatAsync
(
content
,
expected
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
expected
);
}
[
Fact
]
...
...
@@ -127,7 +127,7 @@ void F()
}"
;
var
changingOptions
=
new
Dictionary
<
OptionKey
,
object
>();
changingOptions
.
Add
(
CSharpFormattingOptions
.
IndentBlock
,
false
);
await
AssertFormatAsync
(
code
,
expected
,
changedOptionSet
:
changingOptions
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
expected
,
changedOptionSet
:
changingOptions
);
}
[
Fact
]
...
...
@@ -152,7 +152,7 @@ void F()
}"
;
var
changingOptions
=
new
Dictionary
<
OptionKey
,
object
>();
changingOptions
.
Add
(
CSharpFormattingOptions
.
WrappingPreserveSingleLine
,
false
);
await
AssertFormatAsync
(
code
,
expected
,
changedOptionSet
:
changingOptions
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
expected
,
changedOptionSet
:
changingOptions
);
}
[
WorkItem
(
539231
,
"DevDiv"
)]
...
...
src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
浏览文件 @
c1338281
...
...
@@ -18,7 +18,7 @@ public class FormattingEngineTests : CSharpFormattingTestBase
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
public
async
Task
Format1
()
{
await
AssertFormatAsync
(
"namespace A { }"
,
"namespace A{}"
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
"namespace A { }"
,
"namespace A{}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -30,7 +30,7 @@ public async Task Format2()
var
expected
=
@"class A
{
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -45,7 +45,7 @@ public async Task Format3()
int i = 20;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -63,7 +63,7 @@ public async Task Format4()
T.S = Test( 10 );
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -86,7 +86,7 @@ public async Task Format5()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -109,7 +109,7 @@ public async Task Format6()
};
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -125,7 +125,7 @@ public async Task Format7()
var a = from i in new[] { 1, 2, 3 } where i > 10 select i;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -157,7 +157,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -179,7 +179,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -198,7 +198,7 @@ public async Task Format10()
select i;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -230,7 +230,7 @@ public C()
}
};
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -264,7 +264,7 @@ public async Task AnonymousType()
p4 = true
};
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -298,7 +298,7 @@ public async Task MultilineLambda()
return x + 1;
};
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -322,7 +322,7 @@ public async Task AnonymousMethod()
MessageBox.Show(this, ""Timer ticked"");
};
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -389,7 +389,7 @@ static void Method(int i, string s, bool b)
{
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -685,7 +685,7 @@ static void Main()
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -709,7 +709,7 @@ static void Main()
Program p=new Program();
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -729,7 +729,7 @@ public async Task Scen4()
// // TODO: Add the implementation for Class1.foo() here.
//
// }
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -753,7 +753,7 @@ public void Method()
System.Console.WriteLine();
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -775,7 +775,7 @@ class InnerClass
{
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -811,7 +811,7 @@ public void Method()
z:
i = 2 * i;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -829,7 +829,7 @@ public void Method()
{
int i = 10;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -851,7 +851,7 @@ void Foo()
int y = 0;
int z = 0;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -867,7 +867,7 @@ public async Task IndentFieldsInClass()
int a = 10;
int b;
int c;
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -947,7 +947,7 @@ public void nothing_again(Action a)
l:
goto l;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
WorkItem
(
766133
,
"DevDiv"
)]
...
...
@@ -987,7 +987,7 @@ class D
{
public int A { get; set; }
public int B { get; set; }
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1015,7 +1015,7 @@ public void nothing()
string s = o as string;
bool b = o is string;
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
WorkItem
(
772298
,
"DevDiv"
)]
...
...
@@ -1046,7 +1046,7 @@ public void nothing()
Console.WriteLine(""Nothing"");
});
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1132,7 +1132,7 @@ public void nothing_again(Action a)
l:
goto l;
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1172,7 +1172,7 @@ void bar()
switch (x) { case 1: break; case 2: break; default: break; }
Del d = delegate(int k) { Console.WriteLine(); Console.WriteLine(); };
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1241,7 +1241,7 @@ void bar()
}
void foo() { int xx = 0; int zz = 0;}
}
class foo{int x = 0;}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
class foo{int x = 0;}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1306,7 +1306,7 @@ void bar()
class foo
{
int x = 0;
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1386,7 +1386,7 @@ void bar()
Del d = delegate(int k) { Console.WriteLine(); Console.WriteLine(); };
}
}
class foo{int x = 0;}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
class foo{int x = 0;}"
,
false
,
changingOptions
);
}
[
WorkItem
(
991480
)]
...
...
@@ -1408,7 +1408,7 @@ static void Main(string[] args)
{
for (int d = 0; d < 10; ++d) { }
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
WorkItem
(
751789
,
"DevDiv"
)]
...
...
@@ -1533,7 +1533,7 @@ public class foo : System.Object
{
public int f { get; set; }
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
WorkItem
(
751789
,
"DevDiv"
)]
...
...
@@ -1644,7 +1644,7 @@ public class foo : System.Object
{
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1701,7 +1701,7 @@ void f00()
return 0;
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1764,7 +1764,7 @@ void f00()
return 0;
}
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1831,7 +1831,7 @@ void br()
};
MyObject obj = new MyObject { X1 = 0, Y1 = 1, X2 = 2, Y2 = 3 };
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1895,7 +1895,7 @@ void br()
Y2 = 3
};
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1911,13 +1911,13 @@ public async Task Enums_Bug2586()
a = 10,
b,
c
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
public
async
Task
DontInsertLineBreaksInSingleLineEnum
()
{
await
AssertFormatAsync
(
@"enum E { a = 10, b, c }"
,
@"enum E { a = 10, b, c }"
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
@"enum E { a = 10, b, c }"
,
@"enum E { a = 10, b, c }"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1943,7 +1943,7 @@ void M()
break;
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1969,7 +1969,7 @@ void M()
break;
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1999,7 +1999,7 @@ void M()
}
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2025,7 +2025,7 @@ void M()
default: break;
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2051,7 +2051,7 @@ void M()
default: { break; }
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2071,7 +2071,7 @@ void M()
Foo:
goto Foo;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2093,7 +2093,7 @@ void M()
Foo:
goto Foo;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2119,7 +2119,7 @@ void M()
goto Foo;
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2147,7 +2147,7 @@ void M()
goto Foo;
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2167,7 +2167,7 @@ void M()
Foo:
goto Foo;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2185,7 +2185,7 @@ void M()
{
Foo: goto Foo;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2207,7 +2207,7 @@ void M()
Foo:
goto Foo;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2223,7 +2223,7 @@ public async Task DontAddLineBreakBeforeWhere1_Bug2582()
void M<T>() where T : I
{
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2233,7 +2233,7 @@ public async Task DontAddLineBreakBeforeWhere2_Bug2582()
{
}"
,
@"class C<T> where T : I
{
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2251,7 +2251,7 @@ void M()
{
int x = -1;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2269,7 +2269,7 @@ void M()
{
int x = +1;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2283,7 +2283,7 @@ void M(int[] i)
++i[0];
}
}"
;
await
AssertFormatAsync
(
code
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2297,7 +2297,7 @@ void M(int[] i)
i[0]++;
}
}"
;
await
AssertFormatAsync
(
code
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2311,7 +2311,7 @@ void M(int[] i)
--i[0];
}
}"
;
await
AssertFormatAsync
(
code
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2325,7 +2325,7 @@ void M(int[] i)
i[0]--;
}
}"
;
await
AssertFormatAsync
(
code
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2347,7 +2347,7 @@ void M()
0, 1,
2);
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2365,7 +2365,7 @@ void M()
{
if ( ! true ) ;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2387,7 +2387,7 @@ class C { }
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2424,7 +2424,7 @@ class C {
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2456,7 +2456,7 @@ class C {
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2485,7 +2485,7 @@ class C {
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2501,7 +2501,7 @@ public async Task Base1()
C ( ) : base ( )
{
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2521,7 +2521,7 @@ public async Task This1()
}
C ( ) { }
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2541,7 +2541,7 @@ int Method()
var q =
from c in from b in cs select b select c;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2565,7 +2565,7 @@ int Method()
select b
select c;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2595,7 +2595,7 @@ int Method()
3)
select new { b, c };
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2621,7 +2621,7 @@ int Method()
select b
select c;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2639,7 +2639,7 @@ int Method()
{
L : int i = 10 ;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2659,7 +2659,7 @@ int Method()
int x = 1 ;
L : int i = 10 ;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2681,7 +2681,7 @@ int Method()
L :
int i = 10 ;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2703,7 +2703,7 @@ int Method()
L : int i = 10 ;
int next = 30;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2723,7 +2723,7 @@ int Method()
L : int i = 10 ;
int next = 30;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2745,7 +2745,7 @@ int Method()
int i = 10 ;
int next = 30;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2769,7 +2769,7 @@ int Method()
int i = 10 ;
int next = 30;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2791,7 +2791,7 @@ int Method()
int i =
10;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2805,7 +2805,7 @@ public async Task AutoProperty()
{
private int Age{get; set; }
public string Names { get; set;}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2831,7 +2831,7 @@ public string Names
return name;
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2865,7 +2865,7 @@ public string Names
name = value;
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -2883,7 +2883,7 @@ int Method()
{
int a b c ;
}
} "
)
.
ConfigureAwait
(
true
)
;
} "
);
}
[
WorkItem
(
537763
,
"DevDiv"
)]
...
...
@@ -2902,7 +2902,7 @@ static void Main(string[] args)
{
int ? i = 10;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
WorkItem
(
537766
,
"DevDiv"
)]
...
...
@@ -2913,7 +2913,7 @@ public async Task SuppressWrappingOnBraces()
{ }
"
,
@"class Class1
{}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537824
,
"DevDiv"
)]
...
...
@@ -2938,7 +2938,7 @@ void Foo()
}while (true);
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537774
,
"DevDiv"
)]
...
...
@@ -2958,7 +2958,7 @@ int Foo()
{return 0;
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537768
,
"DevDiv"
)]
...
...
@@ -2979,7 +2979,7 @@ static void Main(string[] args)
{
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537878
,
"DevDiv"
)]
...
...
@@ -3006,7 +3006,7 @@ void Foo()
}
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537783
,
"DevDiv"
)]
...
...
@@ -3029,7 +3029,7 @@ static void Main(string[] args)
a = a++ + 5;
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537885
,
"DevDiv"
)]
...
...
@@ -3050,7 +3050,7 @@ static void Main(string[] args)
int* p;
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537886
,
"DevDiv"
)]
...
...
@@ -3073,7 +3073,7 @@ static void Main(string[] args)
j = ~7;
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537884
,
"DevDiv"
)]
...
...
@@ -3098,7 +3098,7 @@ static void Main(string[] args)
};
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537884
,
"DevDiv"
)]
...
...
@@ -3123,7 +3123,7 @@ static void Main(string[] args)
};
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537884
,
"DevDiv"
)]
...
...
@@ -3148,7 +3148,7 @@ static void Main(string[] args)
} ;
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537884
,
"DevDiv"
)]
...
...
@@ -3173,7 +3173,7 @@ static void Main(string[] args)
};
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537916
,
"DevDiv"
)]
...
...
@@ -3196,7 +3196,7 @@ void Method()
int* p = &a;
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537885
,
"DevDiv"
)]
...
...
@@ -3221,7 +3221,7 @@ void Method()
Console.WriteLine(* p);
}
}
"
)
.
ConfigureAwait
(
true
)
;
"
);
}
[
WorkItem
(
537905
,
"DevDiv"
)]
...
...
@@ -3229,7 +3229,7 @@ void Method()
public
async
Task
Namespaces
()
{
await
AssertFormatAsync
(
@"using System;
using System.Data;"
,
@"using System; using System.Data;"
)
.
ConfigureAwait
(
true
)
;
using System.Data;"
,
@"using System; using System.Data;"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -3239,7 +3239,7 @@ public async Task NamespaceDeclaration()
{
}"
,
@"namespace N
{
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
WorkItem
(
537902
,
"DevDiv"
)]
...
...
@@ -3260,7 +3260,7 @@ static void Main(string[] args)
do { }
while (i < 4);
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -3276,7 +3276,7 @@ void Test<T>(T t) where T : new()
void Test<T>(T t) where T : new ( )
{
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -3308,7 +3308,7 @@ static void Main(string[] args)
return;
}
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -3321,7 +3321,7 @@ public async Task Attributes1()
}"
,
@"class Program
{
[ Flags ] public void Method ( ) { }
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -3335,7 +3335,7 @@ public async Task Attributes2()
{
[ Flags ]
public void Method ( ) { }
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
WorkItem
(
538288
,
"DevDiv"
)]
...
...
@@ -3353,7 +3353,7 @@ public void Method()
public void Method ( ) {
throw new global :: System.NotImplementedException();
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
WorkItem
(
538354
,
"DevDiv"
)]
...
...
@@ -3366,14 +3366,14 @@ public async Task BugFix3939()
Generic;"
,
@" using
System.
Collections.
Generic;"
)
.
ConfigureAwait
(
true
)
;
Generic;"
);
}
[
WorkItem
(
538354
,
"DevDiv"
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
public
async
Task
Tab1
()
{
await
AssertFormatAsync
(
@"using System;"
,
@" using System;"
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
@"using System;"
,
@" using System;"
);
}
[
WorkItem
(
538329
,
"DevDiv"
)]
...
...
@@ -3396,7 +3396,7 @@ static void Main(string[] args)
if (true) a = 10;
else a = 11;
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
WorkItem
(
538464
,
"DevDiv"
)]
...
...
@@ -3415,7 +3415,7 @@ static void Main(string[] args)
{
Func<int, int> fun = x => { return x + 1; }
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
]
...
...
@@ -3439,7 +3439,7 @@ void Test()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3457,7 +3457,7 @@ public async Task Finalizer()
~Class1() { }
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3475,7 +3475,7 @@ static void Main(string[] args)
}
}"
;
await
AssertFormatAsync
(
code
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
code
);
}
[
Fact
]
...
...
@@ -3497,7 +3497,7 @@ static void Main(string[] args)
double d = new double();
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3523,7 +3523,7 @@ static void Main(string[] args)
var t2 = sizeof(System.Object);
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3544,7 +3544,7 @@ static void Main(string[] args)
var a = (int)1;
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3565,7 +3565,7 @@ static void Main(string[] args)
Main(args: null);
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
539259
,
"DevDiv"
)]
...
...
@@ -3589,7 +3589,7 @@ static void Main(string[] args)
delegate (int x) { return x; });
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
539338
,
"DevDiv"
)]
...
...
@@ -3605,7 +3605,7 @@ public async Task BugFix5251()
{
public static string Foo { get; private set; }
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
539358
,
"DevDiv"
)]
...
...
@@ -3621,7 +3621,7 @@ public async Task BugFix5277()
#if true
#endif
"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
539542
,
"DevDiv"
)]
...
...
@@ -3649,7 +3649,7 @@ unsafe static void Main(string[] args)
}
}
"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
539587
,
"DevDiv"
)]
...
...
@@ -3671,7 +3671,7 @@ public static void func()
long b = //
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
539616
,
"DevDiv"
)]
...
...
@@ -3693,7 +3693,7 @@ public static void func()
{
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3712,7 +3712,7 @@ class N : Bug<T[]>
{
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3758,7 +3758,7 @@ static void Main(string[] args)
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3790,7 +3790,7 @@ static void Main(string[] args)
};
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3820,7 +3820,7 @@ public static void Main()
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3842,7 +3842,7 @@ public static void Main()
int i = - -1 + + +1 + -+1 + -+1;
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3871,7 +3871,7 @@ static void Main(string[] args)
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3900,7 +3900,7 @@ static void Main(string[] args)
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3929,7 +3929,7 @@ static void Main(string[] args)
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3952,7 +3952,7 @@ void M()
object o2 = null ?? null;
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -3983,7 +3983,7 @@ static void Main(string[] args)
select w;
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4008,7 +4008,7 @@ static void Main(string[] args)
select x into
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4029,7 +4029,7 @@ void AddClass(string name, [OptionalAttribute] object position, [OptionalAttr
{
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4064,7 +4064,7 @@ static void Main(string[] args)
}, isThreadSafe: true);
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4092,7 +4092,7 @@ public innerClass()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4104,7 +4104,7 @@ public async Task ColumnOfVeryFirstToken()
var
expected
=
@" W )b"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4122,7 +4122,7 @@ public async Task EmptySuppressionSpan()
a,,
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4164,7 +4164,7 @@ public static void Main()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4205,7 +4205,7 @@ public async Task FormatArbitaryNode()
Assert
.
NotNull
(
property
);
var
newProperty
=
await
Formatter
.
FormatAsync
(
property
,
new
AdhocWorkspace
())
.
ConfigureAwait
(
true
)
;
var
newProperty
=
await
Formatter
.
FormatAsync
(
property
,
new
AdhocWorkspace
());
Assert
.
Equal
(
expected
,
newProperty
.
ToFullString
());
}
...
...
@@ -4239,7 +4239,7 @@ static void Main(string[] args)
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4279,7 +4279,7 @@ static int Main()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4318,7 +4318,7 @@ where final
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4386,7 +4386,7 @@ public string parfoobar(string[] str)
}
}"
;
await
AssertFormatAsync
(
expectedFormattedText
,
text
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expectedFormattedText
,
text
);
}
[
Fact
]
...
...
@@ -4417,7 +4417,7 @@ void bar()
}
}
}"
;
await
AssertFormatAsync
(
expectedCode
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expectedCode
,
code
);
}
[
Fact
]
...
...
@@ -4438,7 +4438,7 @@ public async Task PreprocessorOnSameLine()
#line hidden"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4458,7 +4458,7 @@ public class A : Attribute
public int[] X;
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4486,7 +4486,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4518,7 +4518,7 @@ void M()
}
"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4528,7 +4528,7 @@ public async Task UnicodeWhitespace()
{
var
code
=
"\u001A"
;
await
AssertFormatAsync
(
""
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
""
,
code
);
}
[
Fact
]
...
...
@@ -4550,7 +4550,7 @@ public int P
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4596,7 +4596,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4630,7 +4630,7 @@ void F()
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
false
,
changingOptions
);
}
[
Fact
]
...
...
@@ -4657,7 +4657,7 @@ void F()
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4682,7 +4682,7 @@ int M()
select c;
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4745,7 +4745,7 @@ void M
List<bool> b
);
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -4758,7 +4758,7 @@ public async Task Bugfix_776513_CheckBraceIfNotMissingBeforeApplyingOperationFor
var
expected
=
@"var alwaysTriggerList = new[]
Dim triggerOnlyWithLettersList ="
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
769342
,
"DevDiv"
)]
...
...
@@ -4783,7 +4783,7 @@ class Program
class Program
{
}
}"
,
changedOptionSet
:
optionSet
)
.
ConfigureAwait
(
true
)
;
}"
,
changedOptionSet
:
optionSet
);
}
[
WorkItem
(
797278
,
"DevDiv"
)]
...
...
@@ -4875,7 +4875,7 @@ public void foo()
}
}"
;
var
optionSet
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpFormattingOptions
.
SpaceWithinOtherParentheses
,
true
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
optionSet
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
optionSet
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -4950,7 +4950,7 @@ public void foo()
}
}"
;
var
optionSet
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpFormattingOptions
.
SpaceAfterControlFlowStatementKeyword
,
false
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
optionSet
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
optionSet
);
}
[
WorkItem
(
766212
,
"DevDiv"
)]
...
...
@@ -4975,7 +4975,7 @@ public void Main()
var digits = new List<int> { 1, 2, 3, 4 };
}
}"
;
await
AssertFormatAsync
(
expectedDefault
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expectedDefault
,
code
);
var
expectedAfterCommaDisabled
=
@"
class Program
...
...
@@ -4987,7 +4987,7 @@ public void Main()
}
}"
;
var
optionSet
=
new
Dictionary
<
OptionKey
,
object
>
{
{
CSharpFormattingOptions
.
SpaceAfterComma
,
false
}
};
await
AssertFormatAsync
(
expectedAfterCommaDisabled
,
code
,
changedOptionSet
:
optionSet
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expectedAfterCommaDisabled
,
code
,
changedOptionSet
:
optionSet
);
var
expectedBeforeCommaEnabled
=
@"
class Program
...
...
@@ -4999,7 +4999,7 @@ public void Main()
}
}"
;
optionSet
.
Add
(
CSharpFormattingOptions
.
SpaceBeforeComma
,
true
);
await
AssertFormatAsync
(
expectedBeforeCommaEnabled
,
code
,
changedOptionSet
:
optionSet
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expectedBeforeCommaEnabled
,
code
,
changedOptionSet
:
optionSet
);
}
[
Fact
]
...
...
@@ -5040,7 +5040,7 @@ int M()
}
}
"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -5101,7 +5101,7 @@ public void CreateSettingsFile(string path, string comment)
}
}
"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -5136,7 +5136,7 @@ void Method()
}
}
"
;
await
AssertFormatAsync
(
expected
,
code
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
false
,
changingOptions
);
}
[
Fact
]
...
...
@@ -5173,7 +5173,7 @@ static void Main(string[] args)
}
}
"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
]
...
...
@@ -5245,8 +5245,8 @@ private void MenuItemCallback(object sender, EventArgs e)
"
;
var
optionSet
=
new
Dictionary
<
OptionKey
,
object
>
{
{
new
OptionKey
(
FormattingOptions
.
UseTabs
,
LanguageNames
.
CSharp
),
true
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
optionSet
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
expected
,
changedOptionSet
:
optionSet
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
optionSet
);
await
AssertFormatAsync
(
expected
,
expected
,
changedOptionSet
:
optionSet
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5265,7 +5265,7 @@ class C
}"
;
var
options
=
new
Dictionary
<
OptionKey
,
object
>()
{
{
CSharpFormattingOptions
.
WrappingPreserveSingleLine
,
false
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5283,7 +5283,7 @@ void foo()
}"
;
var
options
=
new
Dictionary
<
OptionKey
,
object
>()
{
{
CSharpFormattingOptions
.
WrappingPreserveSingleLine
,
false
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5309,7 +5309,7 @@ void foo()
}"
;
var
options
=
new
Dictionary
<
OptionKey
,
object
>()
{
{
CSharpFormattingOptions
.
WrappingKeepStatementsOnSingleLine
,
false
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5340,7 +5340,7 @@ class Program
{
SpaceBeforeComma
,
false
},
{
SpaceAfterComma
,
false
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5371,7 +5371,7 @@ class Program
{
SpaceBeforeComma
,
false
},
{
SpaceAfterComma
,
true
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5402,7 +5402,7 @@ class Program
{
SpaceBeforeComma
,
true
},
{
SpaceAfterComma
,
false
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5433,7 +5433,7 @@ class Program
{
SpaceBeforeComma
,
true
},
{
SpaceAfterComma
,
true
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5464,7 +5464,7 @@ class Program
{
SpaceBeforeComma
,
false
},
{
SpaceAfterComma
,
false
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5495,7 +5495,7 @@ class Program
{
SpaceBeforeComma
,
false
},
{
SpaceAfterComma
,
true
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5526,7 +5526,7 @@ class Program
{
SpaceBeforeComma
,
true
},
{
SpaceAfterComma
,
false
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5557,7 +5557,7 @@ class Program
{
SpaceBeforeComma
,
true
},
{
SpaceAfterComma
,
true
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5588,7 +5588,7 @@ class Program
{
SpaceBeforeComma
,
false
},
{
SpaceAfterComma
,
false
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5619,7 +5619,7 @@ class Program
{
SpaceBeforeComma
,
false
},
{
SpaceAfterComma
,
true
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5650,7 +5650,7 @@ class Program
{
SpaceBeforeComma
,
true
},
{
SpaceAfterComma
,
false
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5681,7 +5681,7 @@ class Program
{
SpaceBeforeComma
,
true
},
{
SpaceAfterComma
,
true
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5712,7 +5712,7 @@ class Program
{
SpaceBeforeComma
,
false
},
{
SpaceAfterComma
,
false
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5743,7 +5743,7 @@ class Program
{
SpaceBeforeComma
,
false
},
{
SpaceAfterComma
,
true
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5774,7 +5774,7 @@ class Program
{
SpaceBeforeComma
,
true
},
{
SpaceAfterComma
,
false
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5805,7 +5805,7 @@ class Program
{
SpaceBeforeComma
,
true
},
{
SpaceAfterComma
,
true
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5828,7 +5828,7 @@ class Program
{
CSharpFormattingOptions
.
SpaceWithinSquareBrackets
,
true
},
{
CSharpFormattingOptions
.
SpaceBetweenEmptySquareBrackets
,
false
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5847,7 +5847,7 @@ class Program
}"
;
var
options
=
new
Dictionary
<
OptionKey
,
object
>()
{
{
CSharpFormattingOptions
.
SpaceBeforeOpenSquareBracket
,
true
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -5866,7 +5866,7 @@ class Program
}"
;
var
options
=
new
Dictionary
<
OptionKey
,
object
>()
{
{
CSharpFormattingOptions
.
SpaceWithinSquareBrackets
,
true
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
WorkItem
(
917351
,
"DevDiv"
)]
...
...
@@ -5901,7 +5901,7 @@ public void Method()
{
CSharpFormattingOptions
.
NewLinesForBracesInControlBlocks
,
false
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
WorkItem
(
962416
,
"DevDiv"
)]
...
...
@@ -5941,7 +5941,7 @@ public void Method()
{
CSharpFormattingOptions
.
NewLinesForBracesInControlBlocks
,
false
}
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
options
);
}
[
WorkItem
(
953535
,
"DevDiv"
)]
...
...
@@ -5984,7 +5984,7 @@ static void Main(string[] args)
}
}"
;
var
parseOptions
=
new
CSharpParseOptions
();
await
AssertFormatAsync
(
expected
,
code
,
parseOptions
:
parseOptions
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
parseOptions
:
parseOptions
);
}
[
WorkItem
(
924172
,
"DevDiv"
)]
...
...
@@ -6010,7 +6010,7 @@ static void Main(string[] args)
int s;
}
}"
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
changingOptions
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
changingOptions
);
}
[
WorkItem
(
899492
,
"DevDiv"
)]
...
...
@@ -6040,7 +6040,7 @@ void M()
M();
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
991547
,
"DevDiv"
)]
...
...
@@ -6068,7 +6068,7 @@ void M()
finally { }
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6094,7 +6094,7 @@ void M()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6122,7 +6122,7 @@ void M()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6148,7 +6148,7 @@ void M()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6176,7 +6176,7 @@ void M()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6202,7 +6202,7 @@ void M()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6230,7 +6230,7 @@ void M()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6256,7 +6256,7 @@ void M()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6284,7 +6284,7 @@ void M()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6310,7 +6310,7 @@ void M()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6334,7 +6334,7 @@ void M()
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
1041787
)]
...
...
@@ -6359,7 +6359,7 @@ static void Main(string[] args)
{
Console.WriteLine(""""); // FooBar
}
}"
,
false
,
optionSet
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
optionSet
);
}
[
WorkItem
(
961559
)]
...
...
@@ -6385,7 +6385,7 @@ static void Main(string[] args)
{
Console.WriteLine(""""); /* FooBar */
}
}"
,
false
,
optionSet
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
optionSet
);
}
[
WorkItem
(
1100920
)]
...
...
@@ -6404,7 +6404,7 @@ static string F(int a, int b, int c)
{
return $""{a} (index: 0x{ b}, size: { c}): ""
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
WorkItem
(
62
)]
...
...
@@ -6445,7 +6445,7 @@ void M()
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
285
)]
...
...
@@ -6476,7 +6476,7 @@ static void Main(string[] args)
#endif
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
285
)]
...
...
@@ -6507,7 +6507,7 @@ static void Main(string[] args)
#endif
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
285
)]
...
...
@@ -6540,7 +6540,7 @@ static void Main(string[] args)
#endif
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
1118
,
"https://github.com/dotnet/roslyn/issues/1118"
)]
...
...
@@ -6548,7 +6548,7 @@ static void Main(string[] args)
public
async
Task
DontAssumeCertainNodeAreAlwaysParented
()
{
var
block
=
SyntaxFactory
.
Block
();
await
Formatter
.
FormatAsync
(
block
,
new
AdhocWorkspace
())
.
ConfigureAwait
(
true
)
;
await
Formatter
.
FormatAsync
(
block
,
new
AdhocWorkspace
());
}
[
WorkItem
(
776
,
"https://github.com/dotnet/roslyn/issues/776"
)]
...
...
@@ -6571,7 +6571,7 @@ class Program
static void Main(string[] args)
{
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
WorkItem
(
776
,
"https://github.com/dotnet/roslyn/issues/776"
)]
...
...
@@ -6585,7 +6585,7 @@ static void Main(string[] args)
{
}
}"
;
await
AssertFormatAsync
(
code
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
code
);
}
[
Fact
]
...
...
@@ -6623,7 +6623,7 @@ public void foo()
{
CSharpFormattingOptions
.
SpaceAfterMethodCallName
,
true
},
{
CSharpFormattingOptions
.
SpaceBetweenEmptyMethodCallParentheses
,
true
},
};
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
optionSet
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
optionSet
);
}
[
WorkItem
(
1298
,
"https://github.com/dotnet/roslyn/issues/1298"
)]
...
...
@@ -6653,7 +6653,7 @@ class Program
public class ExcludeValidation
{
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
1339
,
"https://github.com/dotnet/roslyn/issues/1339"
)]
...
...
@@ -6668,7 +6668,7 @@ static void Main(string[] args)
{
}
}"
;
await
AssertFormatAsync
(
code
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6694,7 +6694,7 @@ void Main()
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
4421
,
"https://github.com/dotnet/roslyn/issues/4421"
)]
...
...
@@ -6716,7 +6716,7 @@ public async Task VerifySpacingAfterMethodDeclarationName_Default()
public static void M() { }
public void F<T>() { }
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
4240
,
"https://github.com/dotnet/roslyn/issues/4240"
)]
...
...
@@ -6740,7 +6740,7 @@ public async Task VerifySpacingAfterMethodDeclarationName_NonDefault()
public static void M () { }
public void F<T> () { }
}"
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
changingOptions
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
changingOptions
);
}
[
WorkItem
(
939
,
"https://github.com/dotnet/roslyn/issues/939"
)]
...
...
@@ -6768,7 +6768,7 @@ static void Main(string[] args)
};
}
}"
;
await
AssertFormatAsync
(
code
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
code
);
}
[
WorkItem
(
1184285
)]
...
...
@@ -6790,7 +6790,7 @@ void Main()
var sample = new Dictionary<string, string> { [""x""] = ""d"", [""z""] = ""XX"" };
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
3256
,
"https://github.com/dotnet/roslyn/issues/3256"
)]
...
...
@@ -6825,7 +6825,7 @@ public void foo()
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
);
}
[
WorkItem
(
3256
,
"https://github.com/dotnet/roslyn/issues/3256"
)]
...
...
@@ -6863,7 +6863,7 @@ public void foo()
}
}
}"
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
changingOptions
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
code
,
changedOptionSet
:
changingOptions
);
}
[
WorkItem
(
4014
,
"https://github.com/dotnet/roslyn/issues/4014"
)]
...
...
@@ -6884,7 +6884,7 @@ static void Main()
{
return // Note the missing semicolon
} // The tab here should stay a tab
}"
,
changedOptionSet
:
optionSet
)
.
ConfigureAwait
(
true
)
;
}"
,
changedOptionSet
:
optionSet
);
}
[
WorkItem
(
4014
,
"https://github.com/dotnet/roslyn/issues/4014"
)]
...
...
@@ -6907,7 +6907,7 @@ public Foo(readonly string bar)
public Foo(readonly string bar)
{
}
}"
,
changedOptionSet
:
optionSet
)
.
ConfigureAwait
(
true
)
;
}"
,
changedOptionSet
:
optionSet
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6944,7 +6944,7 @@ int MethodFoo()
{
return 42;
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -6981,7 +6981,7 @@ int MethodFoo()
{
return 42;
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -7018,7 +7018,7 @@ int MethodFoo()
{
return 42;
}
}"
,
false
,
changingOptions
)
.
ConfigureAwait
(
true
)
;
}"
,
false
,
changingOptions
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -7036,7 +7036,7 @@ void M()
}
"
;
await
AssertFormatAsync
(
code
,
code
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
code
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -7057,7 +7057,7 @@ class C
class C
{
string Name { get ; set ; }
}"
,
changedOptionSet
:
changedOptionSet
)
.
ConfigureAwait
(
true
)
;
}"
,
changedOptionSet
:
changedOptionSet
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -7080,7 +7080,7 @@ public Int32 PaymentMethodID
[System.Diagnostics.DebuggerStepThrough]
get { return 10; }
}
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -7095,7 +7095,7 @@ class Program
class Program
{
public int SomeProperty { [SomeAttribute] get; [SomeAttribute] private set; }
}"
)
.
ConfigureAwait
(
true
)
;
}"
);
}
}
}
src/Workspaces/CSharpTest/Formatting/FormattingTriviaTests.cs
浏览文件 @
c1338281
...
...
@@ -26,7 +26,7 @@ public async Task PreprocessorInEmptyFile()
#error
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -38,7 +38,7 @@ class C { }";
var
expected
=
@"// single line comment
class C { }"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -56,7 +56,7 @@ public async Task Comment2()
int i;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -72,7 +72,7 @@ public async Task Comment3()
// single line comment
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -92,7 +92,7 @@ public async Task Comment4()
void Method() { }
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -115,7 +115,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -140,7 +140,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -169,7 +169,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -194,7 +194,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -219,7 +219,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -246,7 +246,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -283,7 +283,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -320,7 +320,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -341,7 +341,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -366,7 +366,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -387,7 +387,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -412,7 +412,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -439,7 +439,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
,
true
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
,
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -468,7 +468,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -499,7 +499,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -530,7 +530,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
// for now, formatting engine doesn't re-indent token if the indentation line contains noisy
...
...
@@ -554,7 +554,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
// for now, formatting engine doesn't re-indent token if the indentation line contains noisy
...
...
@@ -579,7 +579,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -600,7 +600,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -624,7 +624,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -649,7 +649,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -672,7 +672,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -697,7 +697,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -720,7 +720,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -741,7 +741,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -764,7 +764,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -787,7 +787,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -812,7 +812,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -837,7 +837,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -866,7 +866,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -897,7 +897,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -924,7 +924,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -953,7 +953,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -990,7 +990,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1025,7 +1025,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1058,7 +1058,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1083,7 +1083,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1110,7 +1110,7 @@ void Method()
#endif
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1141,7 +1141,7 @@ void Method()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1173,7 +1173,7 @@ void Method()
"
;
// turn off transformation check - conditional directive preprocessor
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1202,7 +1202,7 @@ void Method()
}
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1231,7 +1231,7 @@ void Method()
}
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1260,7 +1260,7 @@ void Method()
}
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1291,7 +1291,7 @@ void Method()
}
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1336,7 +1336,7 @@ public async Task MixAll()
"
;
// turn off transformation check since it doesn't work for conditional directive yet.
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
WorkItem
(
537895
,
"DevDiv"
)]
...
...
@@ -1368,7 +1368,7 @@ void Method()
}
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
WorkItem
(
537895
,
"DevDiv"
)]
...
...
@@ -1398,7 +1398,7 @@ void Method()
}
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
WorkItem
(
537765
,
"DevDiv"
)]
...
...
@@ -1425,7 +1425,7 @@ public async Task Comment25()
}
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
WorkItem
(
537765
,
"DevDiv"
)]
...
...
@@ -1449,7 +1449,7 @@ void Foo()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1464,7 +1464,7 @@ void Foo()
}
}"
;
await
AssertFormatAsync
(
content
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1491,7 +1491,7 @@ void Foo()
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1513,7 +1513,7 @@ void Foo()
}
}"
;
await
AssertFormatAsync
(
code
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1525,7 +1525,7 @@ public async Task Comment30()
var
code
=
@"
// Test"
;
await
AssertFormatAsync
(
code
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1553,7 +1553,7 @@ static void Main(string[] args)
}
"
;
await
AssertFormatAsync
(
code
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
content
);
}
[
WorkItem
(
538703
,
"DevDiv"
)]
...
...
@@ -1578,7 +1578,7 @@ public async Task Comment32()
}
"
;
await
AssertFormatAsync
(
code
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
content
);
}
[
WorkItem
(
542316
,
"DevDiv"
)]
...
...
@@ -1615,7 +1615,7 @@ static void Main(string[] args)
}
"
;
await
AssertFormatAsync
(
code
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
content
);
}
[
WorkItem
(
542546
,
"DevDiv"
)]
...
...
@@ -1623,7 +1623,7 @@ static void Main(string[] args)
public
async
Task
FormatInvalidCode_1
()
{
var
content
=
@"> Roslyn.Utilities.dll! Basic"
;
await
AssertFormatAsync
(
content
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
content
);
}
[
WorkItem
(
542546
,
"DevDiv"
)]
...
...
@@ -1632,7 +1632,7 @@ public async Task FormatInvalidCode_2()
{
var
content
=
@"> Roslyn.Utilities.dll! Line 43 + 0x5 bytes Basic"
;
var
expectedContent
=
@"> Roslyn.Utilities.dll! Line 43 + 0x5 bytes Basic"
;
await
AssertFormatAsync
(
expectedContent
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expectedContent
,
content
);
}
[
WorkItem
(
537895
,
"DevDiv"
)]
...
...
@@ -1669,7 +1669,7 @@ static void Main(string[] args)
#endregion
}
}"
;
await
AssertFormatAsync
(
expectedContent
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expectedContent
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1703,7 +1703,7 @@ static void Main(string[] args)
}
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
...
@@ -1714,7 +1714,7 @@ public async Task NewLineOptions_LineFeedOnly()
// replace all EOL trivia with elastic markers to force the formatter to add EOL back
tree
=
tree
.
ReplaceTrivia
(
tree
.
DescendantTrivia
().
Where
(
tr
=>
tr
.
IsKind
(
SyntaxKind
.
EndOfLineTrivia
)),
(
o
,
r
)
=>
SyntaxFactory
.
ElasticMarker
);
var
formatted
=
await
Formatter
.
FormatAsync
(
tree
,
DefaultWorkspace
,
DefaultWorkspace
.
Options
.
WithChangedOption
(
FormattingOptions
.
NewLine
,
LanguageNames
.
CSharp
,
"\n"
))
.
ConfigureAwait
(
true
)
;
var
formatted
=
await
Formatter
.
FormatAsync
(
tree
,
DefaultWorkspace
,
DefaultWorkspace
.
Options
.
WithChangedOption
(
FormattingOptions
.
NewLine
,
LanguageNames
.
CSharp
,
"\n"
));
var
actual
=
formatted
.
ToFullString
();
var
expected
=
"class C\n{\n}"
;
...
...
@@ -1756,7 +1756,7 @@ class F
.
WithLeadingTrivia
(
SyntaxFactory
.
TriviaList
())
.
WithAdditionalAnnotations
(
SyntaxAnnotation
.
ElasticAnnotation
));
var
formatted
=
await
Formatter
.
FormatAsync
(
tree
,
DefaultWorkspace
,
DefaultWorkspace
.
Options
.
WithChangedOption
(
FormattingOptions
.
UseTabs
,
LanguageNames
.
CSharp
,
true
))
.
ConfigureAwait
(
true
)
;
var
formatted
=
await
Formatter
.
FormatAsync
(
tree
,
DefaultWorkspace
,
DefaultWorkspace
.
Options
.
WithChangedOption
(
FormattingOptions
.
UseTabs
,
LanguageNames
.
CSharp
,
true
));
var
actual
=
formatted
.
ToFullString
();
Assert
.
Equal
(
expected
,
actual
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录