Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
de1edbf0
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,发现更多精彩内容 >>
提交
de1edbf0
编写于
11月 10, 2015
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make more tests async.
上级
dd804e77
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
75 addition
and
82 deletion
+75
-82
src/EditorFeatures/CSharpTest/CSharpGoToAdjacentMemberTests.cs
...ditorFeatures/CSharpTest/CSharpGoToAdjacentMemberTests.cs
+70
-70
src/EditorFeatures/Core/CommandHandlers/GoToAdjacentMemberCommandHandler.cs
.../Core/CommandHandlers/GoToAdjacentMemberCommandHandler.cs
+5
-3
src/EditorFeatures/Test/Workspaces/TestWorkspaceFactory.cs
src/EditorFeatures/Test/Workspaces/TestWorkspaceFactory.cs
+0
-9
未找到文件。
src/EditorFeatures/CSharpTest/CSharpGoToAdjacentMemberTests.cs
浏览文件 @
de1edbf0
...
...
@@ -19,26 +19,26 @@ public class CSharpGoToAdjacentMemberTests
{
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
EmptyFile
()
public
async
Task
EmptyFile
()
{
var
code
=
@"$$"
;
Assert
.
Null
(
GetTargetPosition
(
code
,
next
:
true
));
Assert
.
Null
(
await
GetTargetPositionAsync
(
code
,
next
:
true
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
ClassWithNoMembers
()
public
async
Task
ClassWithNoMembers
()
{
var
code
=
@"class C
{
$$
}"
;
Assert
.
Null
(
GetTargetPosition
(
code
,
next
:
true
));
Assert
.
Null
(
await
GetTargetPositionAsync
(
code
,
next
:
true
));
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
BeforeClassWithMember
()
public
async
Task
BeforeClassWithMember
()
{
var
code
=
@"$$
class C
...
...
@@ -46,12 +46,12 @@ class C
[||]void M() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
AfterClassWithMember
()
public
async
Task
AfterClassWithMember
()
{
var
code
=
@"
class C
...
...
@@ -61,12 +61,12 @@ class C
$$"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
BetweenClasses
()
public
async
Task
BetweenClasses
()
{
var
code
=
@"
class C1
...
...
@@ -81,12 +81,12 @@ class C2
[||]void M() { }
} "
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
BetweenClassesPrevious
()
public
async
Task
BetweenClassesPrevious
()
{
var
code
=
@"
class C1
...
...
@@ -101,12 +101,12 @@ class C2
void M() { }
} "
;
AssertNavigated
(
code
,
next
:
false
);
await
AssertNavigatedAsync
(
code
,
next
:
false
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
FromFirstMemberToSecond
()
public
async
Task
FromFirstMemberToSecond
()
{
var
code
=
@"
class C
...
...
@@ -115,12 +115,12 @@ class C
[||]void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
FromSecondToFirst
()
public
async
Task
FromSecondToFirst
()
{
var
code
=
@"
class C
...
...
@@ -129,12 +129,12 @@ class C
$$void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
false
);
await
AssertNavigatedAsync
(
code
,
next
:
false
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
NextWraps
()
public
async
Task
NextWraps
()
{
var
code
=
@"
class C
...
...
@@ -143,12 +143,12 @@ class C
$$void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
PreviousWraps
()
public
async
Task
PreviousWraps
()
{
var
code
=
@"
class C
...
...
@@ -157,12 +157,12 @@ class C
[||]void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
false
);
await
AssertNavigatedAsync
(
code
,
next
:
false
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
DescendsIntoNestedType
()
public
async
Task
DescendsIntoNestedType
()
{
var
code
=
@"
class C
...
...
@@ -175,12 +175,12 @@ class N
}
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
StopsAtConstructor
()
public
async
Task
StopsAtConstructor
()
{
var
code
=
@"
class C
...
...
@@ -188,12 +188,12 @@ class C
$$void M1() { }
[||]public C() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
StopsAtDestructor
()
public
async
Task
StopsAtDestructor
()
{
var
code
=
@"
class C
...
...
@@ -201,12 +201,12 @@ class C
$$void M1() { }
[||]~C() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
StopsAtOperator
()
public
async
Task
StopsAtOperator
()
{
var
code
=
@"
class C
...
...
@@ -214,11 +214,11 @@ class C
$$void M1() { }
[||]static C operator+(C left, C right) { throw new System.NotImplementedException(); }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
StopsAtField
()
public
async
Task
StopsAtField
()
{
var
code
=
@"
class C
...
...
@@ -226,12 +226,12 @@ class C
$$void M1() { }
[||]int F;
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
StopsAtFieldlikeEvent
()
public
async
Task
StopsAtFieldlikeEvent
()
{
var
code
=
@"
class C
...
...
@@ -239,12 +239,12 @@ class C
$$void M1() { }
[||]event System.EventHandler E;
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
StopsAtAutoProperty
()
public
async
Task
StopsAtAutoProperty
()
{
var
code
=
@"
class C
...
...
@@ -252,12 +252,12 @@ class C
$$void M1() { }
[||]int P { get; set ; }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
StopsAtPropertyWithAccessors
()
public
async
Task
StopsAtPropertyWithAccessors
()
{
var
code
=
@"
class C
...
...
@@ -271,12 +271,12 @@ class C
}
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
SkipsPropertyAccessors
()
public
async
Task
SkipsPropertyAccessors
()
{
var
code
=
@"
class C
...
...
@@ -292,12 +292,12 @@ class C
[||]void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
FromInsideAccessor
()
public
async
Task
FromInsideAccessor
()
{
var
code
=
@"
class C
...
...
@@ -313,12 +313,12 @@ int P
[||]void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
StopsAtIndexerWithAccessors
()
public
async
Task
StopsAtIndexerWithAccessors
()
{
var
code
=
@"
class C
...
...
@@ -332,12 +332,12 @@ class C
}
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
SkipsIndexerAccessors
()
public
async
Task
SkipsIndexerAccessors
()
{
var
code
=
@"
class C
...
...
@@ -353,12 +353,12 @@ class C
[||]void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
StopsAtEventWithAddRemove
()
public
async
Task
StopsAtEventWithAddRemove
()
{
var
code
=
@"
class C
...
...
@@ -372,12 +372,12 @@ class C
}
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
SkipsEventAddRemove
()
public
async
Task
SkipsEventAddRemove
()
{
var
code
=
@"
class C
...
...
@@ -393,12 +393,12 @@ class C
[||]void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
FromInsideMethod
()
public
async
Task
FromInsideMethod
()
{
var
code
=
@"
class C
...
...
@@ -411,12 +411,12 @@ void M1()
[||]void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
NextFromBetweenMethods
()
public
async
Task
NextFromBetweenMethods
()
{
var
code
=
@"
class C
...
...
@@ -428,12 +428,12 @@ class C
[||]void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
PreviousFromBetweenMethods
()
public
async
Task
PreviousFromBetweenMethods
()
{
var
code
=
@"
class C
...
...
@@ -445,12 +445,12 @@ class C
void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
false
);
await
AssertNavigatedAsync
(
code
,
next
:
false
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
NextFromBetweenMethodsInTrailingTrivia
()
public
async
Task
NextFromBetweenMethodsInTrailingTrivia
()
{
var
code
=
@"
class C
...
...
@@ -462,12 +462,12 @@ void M1()
[||]void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
PreviousFromBetweenMethodsInTrailingTrivia
()
public
async
Task
PreviousFromBetweenMethodsInTrailingTrivia
()
{
var
code
=
@"
class C
...
...
@@ -479,12 +479,12 @@ class C
void M2() { }
}"
;
AssertNavigated
(
code
,
next
:
false
);
await
AssertNavigatedAsync
(
code
,
next
:
false
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
StopsAtExpressionBodiedMember
()
public
async
Task
StopsAtExpressionBodiedMember
()
{
var
code
=
@"
class C
...
...
@@ -494,41 +494,41 @@ class C
[||]int M2() => 42;
}"
;
AssertNavigated
(
code
,
next
:
true
);
await
AssertNavigatedAsync
(
code
,
next
:
true
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
NextInScript
()
public
async
Task
NextInScript
()
{
var
code
=
@"
$$void M1() { }
[||]void M2() { }"
;
AssertNavigated
(
code
,
next
:
true
,
sourceCodeKind
:
SourceCodeKind
.
Script
);
await
AssertNavigatedAsync
(
code
,
next
:
true
,
sourceCodeKind
:
SourceCodeKind
.
Script
);
}
[
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
GoToAdjacentMember
)]
[
WorkItem
(
4311
,
"https://github.com/dotnet/roslyn/issues/4311"
)]
public
void
PrevInScript
()
public
async
Task
PrevInScript
()
{
var
code
=
@"
[||]void M1() { }
$$void M2() { }"
;
AssertNavigated
(
code
,
next
:
false
,
sourceCodeKind
:
SourceCodeKind
.
Script
);
await
AssertNavigatedAsync
(
code
,
next
:
false
,
sourceCodeKind
:
SourceCodeKind
.
Script
);
}
private
static
void
AssertNavigated
(
string
code
,
bool
next
,
SourceCodeKind
?
sourceCodeKind
=
null
)
private
static
async
Task
AssertNavigatedAsync
(
string
code
,
bool
next
,
SourceCodeKind
?
sourceCodeKind
=
null
)
{
var
kinds
=
sourceCodeKind
!=
null
?
SpecializedCollections
.
SingletonEnumerable
(
sourceCodeKind
.
Value
)
:
new
[]
{
SourceCodeKind
.
Regular
,
SourceCodeKind
.
Script
};
foreach
(
var
kind
in
kinds
)
{
using
(
var
workspace
=
TestWorkspaceFactory
.
CreateWorkspaceFromLines
(
using
(
var
workspace
=
await
TestWorkspaceFactory
.
CreateWorkspaceFromLinesAsync
(
LanguageNames
.
CSharp
,
new
CSharpCompilationOptions
(
OutputKind
.
DynamicallyLinkedLibrary
),
CSharpParseOptions
.
Default
.
WithKind
(
kind
),
...
...
@@ -537,7 +537,7 @@ private static void AssertNavigated(string code, bool next, SourceCodeKind? sour
var
hostDocument
=
workspace
.
DocumentWithCursor
;
var
document
=
workspace
.
CurrentSolution
.
GetDocument
(
hostDocument
.
Id
);
Assert
.
Empty
(
document
.
GetSyntaxTreeAsync
().
Result
.
GetDiagnostics
());
var
targetPosition
=
GoToAdjacentMemberCommandHandler
.
GetTargetPosition
(
var
targetPosition
=
await
GoToAdjacentMemberCommandHandler
.
GetTargetPositionAsync
(
document
,
hostDocument
.
CursorPosition
.
Value
,
next
,
...
...
@@ -549,9 +549,9 @@ private static void AssertNavigated(string code, bool next, SourceCodeKind? sour
}
}
private
static
int
?
GetTargetPosition
(
string
code
,
bool
next
)
private
static
async
Task
<
int
?>
GetTargetPositionAsync
(
string
code
,
bool
next
)
{
using
(
var
workspace
=
TestWorkspaceFactory
.
CreateWorkspaceFromLines
(
using
(
var
workspace
=
await
TestWorkspaceFactory
.
CreateWorkspaceFromLinesAsync
(
LanguageNames
.
CSharp
,
new
CSharpCompilationOptions
(
OutputKind
.
DynamicallyLinkedLibrary
),
CSharpParseOptions
.
Default
,
...
...
@@ -560,7 +560,7 @@ private static void AssertNavigated(string code, bool next, SourceCodeKind? sour
var
hostDocument
=
workspace
.
DocumentWithCursor
;
var
document
=
workspace
.
CurrentSolution
.
GetDocument
(
hostDocument
.
Id
);
Assert
.
Empty
(
document
.
GetSyntaxTreeAsync
().
Result
.
GetDiagnostics
());
return
GoToAdjacentMemberCommandHandler
.
GetTargetPosition
(
return
await
GoToAdjacentMemberCommandHandler
.
GetTargetPositionAsync
(
document
,
hostDocument
.
CursorPosition
.
Value
,
next
,
...
...
src/EditorFeatures/Core/CommandHandlers/GoToAdjacentMemberCommandHandler.cs
浏览文件 @
de1edbf0
...
...
@@ -5,6 +5,7 @@
using
System.ComponentModel.Composition
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.Editor.Commands
;
using
Microsoft.CodeAnalysis.Editor.Host
;
using
Microsoft.CodeAnalysis.Editor.Shared
;
...
...
@@ -67,7 +68,8 @@ public void ExecuteCommand(GoToAdjacentMemberCommandArgs args, Action nextHandle
int
?
targetPosition
=
null
;
var
waitResult
=
_waitIndicator
.
Wait
(
EditorFeaturesResources
.
Navigating
,
allowCancel
:
true
,
action
:
waitContext
=>
{
targetPosition
=
GetTargetPosition
(
document
,
caretPoint
.
Value
.
Position
,
args
.
Direction
==
NavigateDirection
.
Down
,
waitContext
.
CancellationToken
);
var
task
=
GetTargetPositionAsync
(
document
,
caretPoint
.
Value
.
Position
,
args
.
Direction
==
NavigateDirection
.
Down
,
waitContext
.
CancellationToken
);
targetPosition
=
task
.
WaitAndGetResult
(
waitContext
.
CancellationToken
);
});
if
(
waitResult
==
WaitIndicatorResult
.
Canceled
||
targetPosition
==
null
)
...
...
@@ -81,7 +83,7 @@ public void ExecuteCommand(GoToAdjacentMemberCommandArgs args, Action nextHandle
/// <summary>
/// Internal for testing purposes.
/// </summary>
internal
static
int
?
GetTargetPosition
(
Document
document
,
int
caretPosition
,
bool
next
,
CancellationToken
cancellationToken
)
internal
static
async
Task
<
int
?>
GetTargetPositionAsync
(
Document
document
,
int
caretPosition
,
bool
next
,
CancellationToken
cancellationToken
)
{
var
syntaxFactsService
=
document
.
GetLanguageService
<
ISyntaxFactsService
>();
if
(
syntaxFactsService
==
null
)
...
...
@@ -89,7 +91,7 @@ public void ExecuteCommand(GoToAdjacentMemberCommandArgs args, Action nextHandle
return
null
;
}
var
root
=
document
.
GetSyntaxRootAsync
(
cancellationToken
).
WaitAndGetResult
(
cancellationToken
);
var
root
=
await
document
.
GetSyntaxRootAsync
(
cancellationToken
);
var
members
=
syntaxFactsService
.
GetMethodLevelMembers
(
root
);
if
(
members
.
Count
==
0
)
{
...
...
src/EditorFeatures/Test/Workspaces/TestWorkspaceFactory.cs
浏览文件 @
de1edbf0
...
...
@@ -53,15 +53,6 @@ public partial class TestWorkspaceFactory
private
const
string
AnalyzerFullPathAttributeName
=
"FullPath"
;
private
const
string
AliasAttributeName
=
"Alias"
;
internal
static
TestWorkspace
CreateWorkspaceFromLines
(
string
language
,
CompilationOptions
compilationOptions
,
ParseOptions
parseOptions
,
params
string
[]
content
)
{
return
CreateWorkspaceFromLinesAsync
(
language
,
compilationOptions
,
parseOptions
,
content
).
WaitAndGetResult
(
CancellationToken
.
None
);
}
/// <summary>
/// Creates a single buffer in a workspace.
/// </summary>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录