Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
dd804e77
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,发现更多精彩内容 >>
提交
dd804e77
编写于
11月 10, 2015
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make more tests async.
上级
0758c0c3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
13 deletion
+13
-13
src/EditorFeatures/VisualBasicTest/Diagnostics/GenerateConstructor/GenerateConstructorTests.vb
...agnostics/GenerateConstructor/GenerateConstructorTests.vb
+6
-6
src/Workspaces/CSharp/Portable/Rename/CSharpRenameRewriterLanguageService.cs
...rp/Portable/Rename/CSharpRenameRewriterLanguageService.cs
+3
-4
src/Workspaces/Core/Portable/Rename/ConflictEngine/ConflictResolution.cs
...Core/Portable/Rename/ConflictEngine/ConflictResolution.cs
+3
-2
src/Workspaces/Core/Portable/Rename/ConflictEngine/ConflictResolver.Session.cs
...ortable/Rename/ConflictEngine/ConflictResolver.Session.cs
+1
-1
未找到文件。
src/EditorFeatures/VisualBasicTest/Diagnostics/GenerateConstructor/GenerateConstructorTests.vb
浏览文件 @
dd804e77
...
...
@@ -504,8 +504,8 @@ NewLines("Imports System.Linq \n Class C \n Private v As Integer \n Sub New() \n
<
WorkItem
(
6541
,
"https://github.com/dotnet/Roslyn/issues/6541"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsGenerateConstructor
)
>
Public
Sub
TestGenerateInDerivedType1
()
Test
(
Public
Async
Function
TestGenerateInDerivedType1
()
As
Task
Await
TestAsync
(
"
Public Class Base
Public Sub New(a As String)
...
...
@@ -531,12 +531,12 @@ Public Class Derived
MyBase.New(a)
End Sub
End Class"
)
End
Sub
End
Function
<
WorkItem
(
6541
,
"https://github.com/dotnet/Roslyn/issues/6541"
)
>
<
WpfFact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
CodeActionsGenerateConstructor
)
>
Public
Sub
TestGenerateInDerivedType2
()
Test
(
Public
Async
Function
TestGenerateInDerivedType2
()
As
Task
Await
TestAsync
(
"
Public Class Base
Public Sub New(a As Integer, Optional b As String = Nothing)
...
...
@@ -562,6 +562,6 @@ Public Class Derived
MyBase.New(a, b)
End Sub
End Class"
)
End
Sub
End
Function
End
Class
End
Namespace
src/Workspaces/CSharp/Portable/Rename/CSharpRenameRewriterLanguageService.cs
浏览文件 @
dd804e77
...
...
@@ -218,7 +218,7 @@ public override SyntaxToken VisitToken(SyntaxToken token)
if
(
tokenNeedsConflictCheck
)
{
newToken
=
RenameAndAnnotateAsync
(
token
,
newToken
,
isRenameLocation
,
isOldText
).
WaitAndGetResult
(
_cancellationToken
);
newToken
=
RenameAndAnnotateAsync
(
token
,
newToken
,
isRenameLocation
,
isOldText
).
WaitAndGetResult
_CanCallOnBackground
(
_cancellationToken
);
if
(!
_isProcessingComplexifiedSpans
)
{
...
...
@@ -382,9 +382,8 @@ private async Task<SyntaxToken> RenameAndAnnotateAsync(SyntaxToken token, Syntax
AddModifiedSpan
(
oldSpan
,
newToken
.
Span
);
}
RenameDeclarationLocationReference
[]
renameDeclarationLocations
=
ConflictResolver
.
CreateDeclarationLocationAnnotationsAsync
(
_solution
,
symbols
,
_cancellationToken
)
.
WaitAndGetResult
(
_cancellationToken
);
var
renameDeclarationLocations
=
await
ConflictResolver
.
CreateDeclarationLocationAnnotationsAsync
(
_solution
,
symbols
,
_cancellationToken
).
ConfigureAwait
(
false
);
var
isNamespaceDeclarationReference
=
false
;
if
(
isRenameLocation
&&
token
.
GetPreviousToken
().
IsKind
(
SyntaxKind
.
NamespaceKeyword
))
...
...
src/Workspaces/Core/Portable/Rename/ConflictEngine/ConflictResolution.cs
浏览文件 @
dd804e77
...
...
@@ -6,6 +6,7 @@
using
System.Diagnostics
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.LanguageServices
;
using
Microsoft.CodeAnalysis.Text
;
using
Roslyn.Utilities
;
...
...
@@ -59,14 +60,14 @@ internal void UpdateCurrentSolution(Solution solution)
_newSolution
=
solution
;
}
internal
void
RemoveAllRenameAnnotations
(
IEnumerable
<
DocumentId
>
documentWithRenameAnnotations
,
AnnotationTable
<
RenameAnnotation
>
annotationSet
,
CancellationToken
cancellationToken
)
internal
async
Task
RemoveAllRenameAnnotationsAsync
(
IEnumerable
<
DocumentId
>
documentWithRenameAnnotations
,
AnnotationTable
<
RenameAnnotation
>
annotationSet
,
CancellationToken
cancellationToken
)
{
foreach
(
var
documentId
in
documentWithRenameAnnotations
)
{
if
(
_renamedSpansTracker
.
IsDocumentChanged
(
documentId
))
{
var
document
=
_newSolution
.
GetDocument
(
documentId
);
var
root
=
document
.
GetSyntaxRootAsync
(
cancellationToken
).
WaitAndGetResult
(
cancellationToken
);
var
root
=
await
document
.
GetSyntaxRootAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
// For the computeReplacementToken and computeReplacementNode functions, use
// the "updated" node to maintain any annotation removals from descendants.
...
...
src/Workspaces/Core/Portable/Rename/ConflictEngine/ConflictResolver.Session.cs
浏览文件 @
dd804e77
...
...
@@ -199,7 +199,7 @@ public async Task<ConflictResolution> ResolveConflictsAsync()
// Step 3: Simplify the project
conflictResolution
.
UpdateCurrentSolution
(
await
renamedSpansTracker
.
SimplifyAsync
(
conflictResolution
.
NewSolution
,
documentsByProject
,
_replacementTextValid
,
_renameAnnotations
,
_cancellationToken
).
ConfigureAwait
(
false
));
conflictResolution
.
RemoveAllRenameAnnotations
(
documentsByProject
,
_renameAnnotations
,
_cancellationToken
);
await
conflictResolution
.
RemoveAllRenameAnnotationsAsync
(
documentsByProject
,
_renameAnnotations
,
_cancellationToken
).
ConfigureAwait
(
false
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录