Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
6ff4eecc
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,体验更适合开发者的 AI 搜索 >>
提交
6ff4eecc
编写于
11月 20, 2015
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make less blocking calls in tests.
上级
2668181f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
18 deletion
+18
-18
src/EditorFeatures/CSharpTest/CSharpGoToAdjacentMemberTests.cs
...ditorFeatures/CSharpTest/CSharpGoToAdjacentMemberTests.cs
+2
-2
src/EditorFeatures/CSharpTest/ChangeSignature/RemoveParametersTests.cs
...tures/CSharpTest/ChangeSignature/RemoveParametersTests.cs
+2
-2
src/EditorFeatures/CSharpTest/EditAndContinue/CSharpEditAndContinueAnalyzerTests.cs
...est/EditAndContinue/CSharpEditAndContinueAnalyzerTests.cs
+14
-14
未找到文件。
src/EditorFeatures/CSharpTest/CSharpGoToAdjacentMemberTests.cs
浏览文件 @
6ff4eecc
...
...
@@ -536,7 +536,7 @@ private static async Task AssertNavigatedAsync(string code, bool next, SourceCod
{
var
hostDocument
=
workspace
.
DocumentWithCursor
;
var
document
=
workspace
.
CurrentSolution
.
GetDocument
(
hostDocument
.
Id
);
Assert
.
Empty
(
document
.
GetSyntaxTreeAsync
().
Result
.
GetDiagnostics
());
Assert
.
Empty
(
(
await
document
.
GetSyntaxTreeAsync
())
.
GetDiagnostics
());
var
targetPosition
=
await
GoToAdjacentMemberCommandHandler
.
GetTargetPositionAsync
(
document
,
hostDocument
.
CursorPosition
.
Value
,
...
...
@@ -559,7 +559,7 @@ private static async Task AssertNavigatedAsync(string code, bool next, SourceCod
{
var
hostDocument
=
workspace
.
DocumentWithCursor
;
var
document
=
workspace
.
CurrentSolution
.
GetDocument
(
hostDocument
.
Id
);
Assert
.
Empty
(
document
.
GetSyntaxTreeAsync
().
Result
.
GetDiagnostics
());
Assert
.
Empty
(
(
await
document
.
GetSyntaxTreeAsync
())
.
GetDiagnostics
());
return
await
GoToAdjacentMemberCommandHandler
.
GetTargetPositionAsync
(
document
,
hostDocument
.
CursorPosition
.
Value
,
...
...
src/EditorFeatures/CSharpTest/ChangeSignature/RemoveParametersTests.cs
浏览文件 @
6ff4eecc
...
...
@@ -253,11 +253,11 @@ void M()
{
if
(
updatedDocument
.
Name
==
"C5.cs"
)
{
Assert
.
Contains
(
"void Ext(this C5 c, string s)"
,
updatedDocument
.
GetTextAsync
(
CancellationToken
.
None
).
Result
.
ToString
());
Assert
.
Contains
(
"void Ext(this C5 c, string s)"
,
(
await
updatedDocument
.
GetTextAsync
(
CancellationToken
.
None
))
.
ToString
());
}
else
{
Assert
.
Contains
(
@"c.Ext(""two"");"
,
updatedDocument
.
GetTextAsync
(
CancellationToken
.
None
).
Result
.
ToString
());
Assert
.
Contains
(
@"c.Ext(""two"");"
,
(
await
updatedDocument
.
GetTextAsync
(
CancellationToken
.
None
))
.
ToString
());
}
}
}
...
...
src/EditorFeatures/CSharpTest/EditAndContinue/CSharpEditAndContinueAnalyzerTests.cs
浏览文件 @
6ff4eecc
...
...
@@ -261,11 +261,11 @@ public static void Main()
var
oldSolution
=
workspace
.
CurrentSolution
;
var
newSolution
=
workspace
.
CurrentSolution
.
WithDocumentText
(
documentId
,
SourceText
.
From
(
source2
));
var
oldDocument
=
oldSolution
.
GetDocument
(
documentId
);
var
oldText
=
oldDocument
.
GetTextAsync
().
Result
;
var
oldSyntaxRoot
=
oldDocument
.
GetSyntaxRootAsync
().
Result
;
var
oldText
=
await
oldDocument
.
GetTextAsync
()
;
var
oldSyntaxRoot
=
await
oldDocument
.
GetSyntaxRootAsync
()
;
var
newDocument
=
newSolution
.
GetDocument
(
documentId
);
var
newText
=
newDocument
.
GetTextAsync
().
Result
;
var
newSyntaxRoot
=
newDocument
.
GetSyntaxRootAsync
().
Result
;
var
newText
=
await
newDocument
.
GetTextAsync
()
;
var
newSyntaxRoot
=
await
newDocument
.
GetSyntaxRootAsync
()
;
const
string
oldStatementSource
=
"System.Console.WriteLine(1);"
;
var
oldStatementPosition
=
source1
.
IndexOf
(
oldStatementSource
,
StringComparison
.
Ordinal
);
...
...
@@ -274,7 +274,7 @@ public static void Main()
var
oldStatementSyntax
=
oldSyntaxRoot
.
FindNode
(
oldStatementTextSpan
);
var
baseActiveStatements
=
ImmutableArray
.
Create
(
new
ActiveStatementSpan
(
ActiveStatementFlags
.
LeafFrame
,
oldStatementSpan
));
var
result
=
a
nalyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newDocument
,
default
(
CancellationToken
)).
Result
;
var
result
=
a
wait
analyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newDocument
,
default
(
CancellationToken
))
;
Assert
.
True
(
result
.
HasChanges
);
Assert
.
True
(
result
.
SemanticEdits
[
0
].
PreserveLocalVariables
);
...
...
@@ -319,7 +319,7 @@ public static void Main()
var
newSolution
=
workspace
.
CurrentSolution
.
WithDocumentText
(
documentId
,
SourceText
.
From
(
source2
));
var
baseActiveStatements
=
ImmutableArray
.
Create
<
ActiveStatementSpan
>();
var
result
=
a
nalyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newSolution
.
GetDocument
(
documentId
),
default
(
CancellationToken
)).
Result
;
var
result
=
a
wait
analyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newSolution
.
GetDocument
(
documentId
),
default
(
CancellationToken
))
;
Assert
.
True
(
result
.
HasChanges
);
Assert
.
True
(
result
.
HasChangesAndErrors
);
...
...
@@ -345,7 +345,7 @@ public static void Main()
{
var
document
=
workspace
.
CurrentSolution
.
Projects
.
First
().
Documents
.
First
();
var
baseActiveStatements
=
ImmutableArray
.
Create
<
ActiveStatementSpan
>();
var
result
=
a
nalyzer
.
AnalyzeDocumentAsync
(
workspace
.
CurrentSolution
,
baseActiveStatements
,
document
,
default
(
CancellationToken
)).
Result
;
var
result
=
a
wait
analyzer
.
AnalyzeDocumentAsync
(
workspace
.
CurrentSolution
,
baseActiveStatements
,
document
,
default
(
CancellationToken
))
;
Assert
.
False
(
result
.
HasChanges
);
Assert
.
False
(
result
.
HasChangesAndErrors
);
...
...
@@ -383,7 +383,7 @@ public static void Main()
var
newSolution
=
workspace
.
CurrentSolution
.
WithDocumentText
(
documentId
,
SourceText
.
From
(
source2
));
var
baseActiveStatements
=
ImmutableArray
.
Create
<
ActiveStatementSpan
>();
var
result
=
a
nalyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newSolution
.
GetDocument
(
documentId
),
default
(
CancellationToken
)).
Result
;
var
result
=
a
wait
analyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newSolution
.
GetDocument
(
documentId
),
default
(
CancellationToken
))
;
Assert
.
False
(
result
.
HasChanges
);
Assert
.
False
(
result
.
HasChangesAndErrors
);
...
...
@@ -412,7 +412,7 @@ public static void Main()
{
var
document
=
workspace
.
CurrentSolution
.
Projects
.
First
().
Documents
.
First
();
var
baseActiveStatements
=
ImmutableArray
.
Create
<
ActiveStatementSpan
>();
var
result
=
a
nalyzer
.
AnalyzeDocumentAsync
(
workspace
.
CurrentSolution
,
baseActiveStatements
,
document
,
default
(
CancellationToken
)).
Result
;
var
result
=
a
wait
analyzer
.
AnalyzeDocumentAsync
(
workspace
.
CurrentSolution
,
baseActiveStatements
,
document
,
default
(
CancellationToken
))
;
Assert
.
False
(
result
.
HasChanges
);
Assert
.
False
(
result
.
HasChangesAndErrors
);
...
...
@@ -460,7 +460,7 @@ public static void Main()
var
newSolution
=
workspace
.
CurrentSolution
.
WithDocumentText
(
documentId
,
SourceText
.
From
(
source2
));
var
baseActiveStatements
=
ImmutableArray
.
Create
<
ActiveStatementSpan
>();
var
result
=
a
nalyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newSolution
.
GetDocument
(
documentId
),
default
(
CancellationToken
)).
Result
;
var
result
=
a
wait
analyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newSolution
.
GetDocument
(
documentId
),
default
(
CancellationToken
))
;
Assert
.
True
(
result
.
HasChanges
);
Assert
.
True
(
result
.
HasChangesAndErrors
);
...
...
@@ -489,7 +489,7 @@ public static void Main()
{
var
document
=
workspace
.
CurrentSolution
.
Projects
.
First
().
Documents
.
First
();
var
baseActiveStatements
=
ImmutableArray
.
Create
<
ActiveStatementSpan
>();
var
result
=
a
nalyzer
.
AnalyzeDocumentAsync
(
workspace
.
CurrentSolution
,
baseActiveStatements
,
document
,
default
(
CancellationToken
)).
Result
;
var
result
=
a
wait
analyzer
.
AnalyzeDocumentAsync
(
workspace
.
CurrentSolution
,
baseActiveStatements
,
document
,
default
(
CancellationToken
))
;
Assert
.
False
(
result
.
HasChanges
);
Assert
.
False
(
result
.
HasChangesAndErrors
);
...
...
@@ -529,7 +529,7 @@ public static void Main()
var
newSolution
=
workspace
.
CurrentSolution
.
WithDocumentText
(
documentId
,
SourceText
.
From
(
source2
));
var
baseActiveStatements
=
ImmutableArray
.
Create
<
ActiveStatementSpan
>();
var
result
=
a
nalyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newSolution
.
GetDocument
(
documentId
),
default
(
CancellationToken
)).
Result
;
var
result
=
a
wait
analyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newSolution
.
GetDocument
(
documentId
),
default
(
CancellationToken
))
;
Assert
.
True
(
result
.
HasChanges
);
Assert
.
True
(
result
.
HasChangesAndErrors
);
...
...
@@ -584,7 +584,7 @@ public class D
var
baseActiveStatements
=
ImmutableArray
.
Create
<
ActiveStatementSpan
>();
foreach
(
var
changedDocumentId
in
changedDocuments
)
{
result
.
Add
(
a
nalyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newProject
.
GetDocument
(
changedDocumentId
),
default
(
CancellationToken
)).
Result
);
result
.
Add
(
a
wait
analyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newProject
.
GetDocument
(
changedDocumentId
),
default
(
CancellationToken
))
);
}
Assert
.
True
(
result
.
IsSingle
());
...
...
@@ -634,7 +634,7 @@ public static void Main()
var
baseActiveStatements
=
ImmutableArray
.
Create
<
ActiveStatementSpan
>();
foreach
(
var
changedDocumentId
in
changedDocuments
)
{
result
.
Add
(
a
nalyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newProject
.
GetDocument
(
changedDocumentId
),
default
(
CancellationToken
)).
Result
);
result
.
Add
(
a
wait
analyzer
.
AnalyzeDocumentAsync
(
oldSolution
,
baseActiveStatements
,
newProject
.
GetDocument
(
changedDocumentId
),
default
(
CancellationToken
))
);
}
Assert
.
True
(
result
.
IsSingle
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录