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()
...
@@ -24,13 +24,13 @@ public async Task EndOfLine()
var
content
=
@"namespace A{/*1*/}/*2*/"
;
var
content
=
@"namespace A{/*1*/}/*2*/"
;
var
expected
=
@"namespace A{}"
;
var
expected
=
@"namespace A{}"
;
await
AssertFormatAsync
(
content
,
expected
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
expected
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
public
async
Task
Simple1
()
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
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -48,7 +48,7 @@ class A /*1*/{}/*2*/";
...
@@ -48,7 +48,7 @@ class A /*1*/{}/*2*/";
class A { }"
;
class A { }"
;
await
AssertFormatAsync
(
content
,
expected
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
expected
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -66,7 +66,7 @@ class A /*1*/{}/*2*/";
...
@@ -66,7 +66,7 @@ class A /*1*/{}/*2*/";
class A { }"
;
class A { }"
;
await
AssertFormatAsync
(
content
,
expected
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
expected
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -84,7 +84,7 @@ class A{}/*2*/";
...
@@ -84,7 +84,7 @@ class A{}/*2*/";
class A { }"
;
class A { }"
;
await
AssertFormatAsync
(
content
,
expected
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
expected
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -102,7 +102,7 @@ class A{}/*2*/";
...
@@ -102,7 +102,7 @@ class A{}/*2*/";
class A { }"
;
class A { }"
;
await
AssertFormatAsync
(
content
,
expected
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
expected
);
}
}
[
Fact
]
[
Fact
]
...
@@ -127,7 +127,7 @@ void F()
...
@@ -127,7 +127,7 @@ void F()
}"
;
}"
;
var
changingOptions
=
new
Dictionary
<
OptionKey
,
object
>();
var
changingOptions
=
new
Dictionary
<
OptionKey
,
object
>();
changingOptions
.
Add
(
CSharpFormattingOptions
.
IndentBlock
,
false
);
changingOptions
.
Add
(
CSharpFormattingOptions
.
IndentBlock
,
false
);
await
AssertFormatAsync
(
code
,
expected
,
changedOptionSet
:
changingOptions
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
expected
,
changedOptionSet
:
changingOptions
);
}
}
[
Fact
]
[
Fact
]
...
@@ -152,7 +152,7 @@ void F()
...
@@ -152,7 +152,7 @@ void F()
}"
;
}"
;
var
changingOptions
=
new
Dictionary
<
OptionKey
,
object
>();
var
changingOptions
=
new
Dictionary
<
OptionKey
,
object
>();
changingOptions
.
Add
(
CSharpFormattingOptions
.
WrappingPreserveSingleLine
,
false
);
changingOptions
.
Add
(
CSharpFormattingOptions
.
WrappingPreserveSingleLine
,
false
);
await
AssertFormatAsync
(
code
,
expected
,
changedOptionSet
:
changingOptions
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
expected
,
changedOptionSet
:
changingOptions
);
}
}
[
WorkItem
(
539231
,
"DevDiv"
)]
[
WorkItem
(
539231
,
"DevDiv"
)]
...
...
src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
浏览文件 @
c1338281
此差异已折叠。
点击以展开。
src/Workspaces/CSharpTest/Formatting/FormattingTriviaTests.cs
浏览文件 @
c1338281
...
@@ -26,7 +26,7 @@ public async Task PreprocessorInEmptyFile()
...
@@ -26,7 +26,7 @@ public async Task PreprocessorInEmptyFile()
#error
#error
"
;
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -38,7 +38,7 @@ class C { }";
...
@@ -38,7 +38,7 @@ class C { }";
var
expected
=
@"// single line comment
var
expected
=
@"// single line comment
class C { }"
;
class C { }"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -56,7 +56,7 @@ public async Task Comment2()
...
@@ -56,7 +56,7 @@ public async Task Comment2()
int i;
int i;
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -72,7 +72,7 @@ public async Task Comment3()
...
@@ -72,7 +72,7 @@ public async Task Comment3()
// single line comment
// single line comment
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -92,7 +92,7 @@ public async Task Comment4()
...
@@ -92,7 +92,7 @@ public async Task Comment4()
void Method() { }
void Method() { }
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -115,7 +115,7 @@ void Method()
...
@@ -115,7 +115,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -140,7 +140,7 @@ void Method()
...
@@ -140,7 +140,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -169,7 +169,7 @@ void Method()
...
@@ -169,7 +169,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -194,7 +194,7 @@ void Method()
...
@@ -194,7 +194,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -219,7 +219,7 @@ void Method()
...
@@ -219,7 +219,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -246,7 +246,7 @@ void Method()
...
@@ -246,7 +246,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -283,7 +283,7 @@ void Method()
...
@@ -283,7 +283,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -320,7 +320,7 @@ void Method()
...
@@ -320,7 +320,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -341,7 +341,7 @@ void Method()
...
@@ -341,7 +341,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -366,7 +366,7 @@ void Method()
...
@@ -366,7 +366,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -387,7 +387,7 @@ void Method()
...
@@ -387,7 +387,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -412,7 +412,7 @@ void Method()
...
@@ -412,7 +412,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -439,7 +439,7 @@ void Method()
...
@@ -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
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -468,7 +468,7 @@ void Method()
...
@@ -468,7 +468,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -499,7 +499,7 @@ void Method()
...
@@ -499,7 +499,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -530,7 +530,7 @@ void Method()
...
@@ -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
// for now, formatting engine doesn't re-indent token if the indentation line contains noisy
...
@@ -554,7 +554,7 @@ void Method()
...
@@ -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
// for now, formatting engine doesn't re-indent token if the indentation line contains noisy
...
@@ -579,7 +579,7 @@ void Method()
...
@@ -579,7 +579,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -600,7 +600,7 @@ void Method()
...
@@ -600,7 +600,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -624,7 +624,7 @@ void Method()
...
@@ -624,7 +624,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -649,7 +649,7 @@ void Method()
...
@@ -649,7 +649,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -672,7 +672,7 @@ void Method()
...
@@ -672,7 +672,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -697,7 +697,7 @@ void Method()
...
@@ -697,7 +697,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -720,7 +720,7 @@ void Method()
...
@@ -720,7 +720,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -741,7 +741,7 @@ void Method()
...
@@ -741,7 +741,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -764,7 +764,7 @@ void Method()
...
@@ -764,7 +764,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -787,7 +787,7 @@ void Method()
...
@@ -787,7 +787,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -812,7 +812,7 @@ void Method()
...
@@ -812,7 +812,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -837,7 +837,7 @@ void Method()
...
@@ -837,7 +837,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -866,7 +866,7 @@ void Method()
...
@@ -866,7 +866,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -897,7 +897,7 @@ void Method()
...
@@ -897,7 +897,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -924,7 +924,7 @@ void Method()
...
@@ -924,7 +924,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -953,7 +953,7 @@ void Method()
...
@@ -953,7 +953,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -990,7 +990,7 @@ void Method()
...
@@ -990,7 +990,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1025,7 +1025,7 @@ void Method()
...
@@ -1025,7 +1025,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1058,7 +1058,7 @@ void Method()
...
@@ -1058,7 +1058,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1083,7 +1083,7 @@ void Method()
...
@@ -1083,7 +1083,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1110,7 +1110,7 @@ void Method()
...
@@ -1110,7 +1110,7 @@ void Method()
#endif
#endif
"
;
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1141,7 +1141,7 @@ void Method()
...
@@ -1141,7 +1141,7 @@ void Method()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1173,7 +1173,7 @@ void Method()
...
@@ -1173,7 +1173,7 @@ void Method()
"
;
"
;
// turn off transformation check - conditional directive preprocessor
// turn off transformation check - conditional directive preprocessor
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1202,7 +1202,7 @@ void Method()
...
@@ -1202,7 +1202,7 @@ void Method()
}
}
"
;
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1231,7 +1231,7 @@ void Method()
...
@@ -1231,7 +1231,7 @@ void Method()
}
}
"
;
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1260,7 +1260,7 @@ void Method()
...
@@ -1260,7 +1260,7 @@ void Method()
}
}
"
;
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1291,7 +1291,7 @@ void Method()
...
@@ -1291,7 +1291,7 @@ void Method()
}
}
"
;
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1336,7 +1336,7 @@ public async Task MixAll()
...
@@ -1336,7 +1336,7 @@ public async Task MixAll()
"
;
"
;
// turn off transformation check since it doesn't work for conditional directive yet.
// 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"
)]
[
WorkItem
(
537895
,
"DevDiv"
)]
...
@@ -1368,7 +1368,7 @@ void Method()
...
@@ -1368,7 +1368,7 @@ void Method()
}
}
"
;
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
WorkItem
(
537895
,
"DevDiv"
)]
[
WorkItem
(
537895
,
"DevDiv"
)]
...
@@ -1398,7 +1398,7 @@ void Method()
...
@@ -1398,7 +1398,7 @@ void Method()
}
}
"
;
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
WorkItem
(
537765
,
"DevDiv"
)]
[
WorkItem
(
537765
,
"DevDiv"
)]
...
@@ -1425,7 +1425,7 @@ public async Task Comment25()
...
@@ -1425,7 +1425,7 @@ public async Task Comment25()
}
}
"
;
"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
WorkItem
(
537765
,
"DevDiv"
)]
[
WorkItem
(
537765
,
"DevDiv"
)]
...
@@ -1449,7 +1449,7 @@ void Foo()
...
@@ -1449,7 +1449,7 @@ void Foo()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1464,7 +1464,7 @@ void Foo()
...
@@ -1464,7 +1464,7 @@ void Foo()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
content
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1491,7 +1491,7 @@ void Foo()
...
@@ -1491,7 +1491,7 @@ void Foo()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expected
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expected
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1513,7 +1513,7 @@ void Foo()
...
@@ -1513,7 +1513,7 @@ void Foo()
}
}
}"
;
}"
;
await
AssertFormatAsync
(
code
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1525,7 +1525,7 @@ public async Task Comment30()
...
@@ -1525,7 +1525,7 @@ public async Task Comment30()
var
code
=
@"
var
code
=
@"
// Test"
;
// Test"
;
await
AssertFormatAsync
(
code
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1553,7 +1553,7 @@ static void Main(string[] args)
...
@@ -1553,7 +1553,7 @@ static void Main(string[] args)
}
}
"
;
"
;
await
AssertFormatAsync
(
code
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
content
);
}
}
[
WorkItem
(
538703
,
"DevDiv"
)]
[
WorkItem
(
538703
,
"DevDiv"
)]
...
@@ -1578,7 +1578,7 @@ public async Task Comment32()
...
@@ -1578,7 +1578,7 @@ public async Task Comment32()
}
}
"
;
"
;
await
AssertFormatAsync
(
code
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
content
);
}
}
[
WorkItem
(
542316
,
"DevDiv"
)]
[
WorkItem
(
542316
,
"DevDiv"
)]
...
@@ -1615,7 +1615,7 @@ static void Main(string[] args)
...
@@ -1615,7 +1615,7 @@ static void Main(string[] args)
}
}
"
;
"
;
await
AssertFormatAsync
(
code
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
code
,
content
);
}
}
[
WorkItem
(
542546
,
"DevDiv"
)]
[
WorkItem
(
542546
,
"DevDiv"
)]
...
@@ -1623,7 +1623,7 @@ static void Main(string[] args)
...
@@ -1623,7 +1623,7 @@ static void Main(string[] args)
public
async
Task
FormatInvalidCode_1
()
public
async
Task
FormatInvalidCode_1
()
{
{
var
content
=
@"> Roslyn.Utilities.dll! Basic"
;
var
content
=
@"> Roslyn.Utilities.dll! Basic"
;
await
AssertFormatAsync
(
content
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
content
,
content
);
}
}
[
WorkItem
(
542546
,
"DevDiv"
)]
[
WorkItem
(
542546
,
"DevDiv"
)]
...
@@ -1632,7 +1632,7 @@ public async Task FormatInvalidCode_2()
...
@@ -1632,7 +1632,7 @@ public async Task FormatInvalidCode_2()
{
{
var
content
=
@"> Roslyn.Utilities.dll! Line 43 + 0x5 bytes Basic"
;
var
content
=
@"> Roslyn.Utilities.dll! Line 43 + 0x5 bytes Basic"
;
var
expectedContent
=
@"> 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"
)]
[
WorkItem
(
537895
,
"DevDiv"
)]
...
@@ -1669,7 +1669,7 @@ static void Main(string[] args)
...
@@ -1669,7 +1669,7 @@ static void Main(string[] args)
#endregion
#endregion
}
}
}"
;
}"
;
await
AssertFormatAsync
(
expectedContent
,
content
)
.
ConfigureAwait
(
true
)
;
await
AssertFormatAsync
(
expectedContent
,
content
);
}
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1703,7 +1703,7 @@ static void Main(string[] args)
...
@@ -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
)]
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Formatting
)]
...
@@ -1714,7 +1714,7 @@ public async Task NewLineOptions_LineFeedOnly()
...
@@ -1714,7 +1714,7 @@ public async Task NewLineOptions_LineFeedOnly()
// replace all EOL trivia with elastic markers to force the formatter to add EOL back
// 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
);
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
actual
=
formatted
.
ToFullString
();
var
expected
=
"class C\n{\n}"
;
var
expected
=
"class C\n{\n}"
;
...
@@ -1756,7 +1756,7 @@ class F
...
@@ -1756,7 +1756,7 @@ class F
.
WithLeadingTrivia
(
SyntaxFactory
.
TriviaList
())
.
WithLeadingTrivia
(
SyntaxFactory
.
TriviaList
())
.
WithAdditionalAnnotations
(
SyntaxAnnotation
.
ElasticAnnotation
));
.
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
();
var
actual
=
formatted
.
ToFullString
();
Assert
.
Equal
(
expected
,
actual
);
Assert
.
Equal
(
expected
,
actual
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录