Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
244ab2ba
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,发现更多精彩内容 >>
提交
244ab2ba
编写于
4月 15, 2017
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Require NavTo tests report what spans they expect to be highlighted.
上级
5fba917a
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
123 addition
and
116 deletion
+123
-116
src/EditorFeatures/CSharpTest/Interactive/NavigateTo/InteractiveNavigateToTests.cs
...Test/Interactive/NavigateTo/InteractiveNavigateToTests.cs
+24
-24
src/EditorFeatures/CSharpTest/NavigateTo/NavigateToTests.cs
src/EditorFeatures/CSharpTest/NavigateTo/NavigateToTests.cs
+37
-37
src/EditorFeatures/Core/Implementation/NavigateTo/AbstractNavigateToItemDisplay.cs
...mplementation/NavigateTo/AbstractNavigateToItemDisplay.cs
+6
-0
src/EditorFeatures/Next/NavigateTo/Dev15NavigateToHostVersionService.Dev15ItemDisplayFactory.cs
...15NavigateToHostVersionService.Dev15ItemDisplayFactory.cs
+0
-9
src/EditorFeatures/TestUtilities/NavigateTo/AbstractNavigateToTests.cs
...tures/TestUtilities/NavigateTo/AbstractNavigateToTests.cs
+16
-5
src/EditorFeatures/VisualBasicTest/NavigateTo/NavigateToTests.vb
...torFeatures/VisualBasicTest/NavigateTo/NavigateToTests.vb
+40
-41
未找到文件。
src/EditorFeatures/CSharpTest/Interactive/NavigateTo/InteractiveNavigateToTests.cs
浏览文件 @
244ab2ba
...
...
@@ -47,7 +47,7 @@ public async Task FindClass()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupClass
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"Foo"
)).
Single
(
x
=>
x
.
Kind
!=
"Method"
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Class
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
"[|Foo|]"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Class
);
});
}
...
...
@@ -67,7 +67,7 @@ internal class DogBed
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupClass
,
StandardGlyphItem
.
GlyphItemFriend
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"DogBed"
)).
Single
(
x
=>
x
.
Kind
!=
"Method"
);
VerifyNavigateToResultItem
(
item
,
"DogBed"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Class
);
VerifyNavigateToResultItem
(
item
,
"DogBed"
,
"[|DogBed|]"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Class
);
});
}
...
...
@@ -90,7 +90,7 @@ public void Method()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupMethod
,
StandardGlyphItem
.
GlyphItemPublic
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"Method"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"Method"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
"Method()"
,
$"
{
FeaturesResources
.
type_space
}
Foo.Bar.DogBed"
);
VerifyNavigateToResultItem
(
item
,
"Method"
,
"[|Method|]()"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
$"
{
FeaturesResources
.
type_space
}
Foo.Bar.DogBed"
);
});
}
...
...
@@ -106,7 +106,7 @@ class Foo<T> where T : IEnumerable
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupClass
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"Foo"
)).
Single
(
x
=>
x
.
Kind
!=
"Method"
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Class
,
displayName
:
"Foo<T>"
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
"[|Foo|]<T>"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Class
);
});
}
...
...
@@ -125,7 +125,7 @@ class Foo<U>
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupMethod
,
StandardGlyphItem
.
GlyphItemPublic
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"Bar"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"Bar"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
"Bar<T>(T)"
,
$"
{
FeaturesResources
.
type_space
}
Foo<U>"
);
VerifyNavigateToResultItem
(
item
,
"Bar"
,
"[|Bar|]<T>(T)"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
$"
{
FeaturesResources
.
type_space
}
Foo<U>"
);
});
}
...
...
@@ -178,7 +178,7 @@ class Foo
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupClass
,
StandardGlyphItem
.
GlyphItemFriend
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"Foo"
)).
Single
(
x
=>
x
.
Kind
!=
"Method"
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Class
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
"[|Foo|]"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Class
);
});
}
...
...
@@ -192,7 +192,7 @@ public async Task FindStruct()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupStruct
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"B"
)).
Single
(
x
=>
x
.
Kind
!=
"Method"
);
VerifyNavigateToResultItem
(
item
,
"Bar"
,
MatchKind
.
Prefix
,
NavigateToItemKind
.
Structure
);
VerifyNavigateToResultItem
(
item
,
"Bar"
,
"[|B|]ar"
,
MatchKind
.
Prefix
,
NavigateToItemKind
.
Structure
);
});
}
...
...
@@ -209,7 +209,7 @@ public async Task FindEnum()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupEnum
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"Colors"
)).
Single
(
x
=>
x
.
Kind
!=
"Method"
);
VerifyNavigateToResultItem
(
item
,
"Colors"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Enum
);
VerifyNavigateToResultItem
(
item
,
"Colors"
,
"[|Colors|]"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Enum
);
});
}
...
...
@@ -226,7 +226,7 @@ public async Task FindEnumMember()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupEnumMember
,
StandardGlyphItem
.
GlyphItemPublic
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"R"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"Red"
,
MatchKind
.
Prefix
,
NavigateToItemKind
.
EnumItem
);
VerifyNavigateToResultItem
(
item
,
"Red"
,
"[|R|]ed"
,
MatchKind
.
Prefix
,
NavigateToItemKind
.
EnumItem
);
});
}
...
...
@@ -241,7 +241,7 @@ public async Task FindConstField()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupConstant
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"ba"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"bar"
,
MatchKind
.
Prefix
,
NavigateToItemKind
.
Constant
);
VerifyNavigateToResultItem
(
item
,
"bar"
,
"[|ba|]r"
,
MatchKind
.
Prefix
,
NavigateToItemKind
.
Constant
);
});
}
...
...
@@ -256,7 +256,7 @@ public async Task FindVerbatimIdentifier()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupField
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"string"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"string"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Field
,
displayName
:
"string"
,
additionalInfo
:
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"string"
,
"[|string|]"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Field
,
additionalInfo
:
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -268,7 +268,7 @@ public async Task FindIndexer()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupProperty
,
StandardGlyphItem
.
GlyphItemPublic
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"this"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"this"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Property
,
displayName
:
"this[int]"
,
additionalInfo
:
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"this"
,
"[|this|][int]"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Property
,
additionalInfo
:
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -280,7 +280,7 @@ public async Task FindEvent()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupEvent
,
StandardGlyphItem
.
GlyphItemPublic
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"CEH"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"ChangedEventHandler"
,
MatchKind
.
Regular
,
NavigateToItemKind
.
Event
,
additionalInfo
:
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"ChangedEventHandler"
,
"[|C|]hanged[|E|]vent[|H|]andler"
,
MatchKind
.
Regular
,
NavigateToItemKind
.
Event
,
additionalInfo
:
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -295,7 +295,7 @@ public async Task FindAutoProperty()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupProperty
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"B"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"Bar"
,
MatchKind
.
Prefix
,
NavigateToItemKind
.
Property
,
additionalInfo
:
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"Bar"
,
"[|B|]ar"
,
MatchKind
.
Prefix
,
NavigateToItemKind
.
Property
,
additionalInfo
:
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -310,7 +310,7 @@ public async Task FindMethod()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupMethod
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"DS"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"DoSomething"
,
MatchKind
.
Regular
,
NavigateToItemKind
.
Method
,
"DoSomething()"
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"DoSomething"
,
"[|D|]o[|S|]omething()"
,
MatchKind
.
Regular
,
NavigateToItemKind
.
Method
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -327,7 +327,7 @@ void DoSomething(int a, string b)
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupMethod
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"DS"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"DoSomething"
,
MatchKind
.
Regular
,
NavigateToItemKind
.
Method
,
"DoSomething(int, string)"
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"DoSomething"
,
"[|D|]o[|S|]omething(int, string)"
,
MatchKind
.
Regular
,
NavigateToItemKind
.
Method
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -344,7 +344,7 @@ public Foo()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupMethod
,
StandardGlyphItem
.
GlyphItemPublic
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"Foo"
)).
Single
(
t
=>
t
.
Kind
==
NavigateToItemKind
.
Method
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
"Foo()"
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
"[|Foo|]()"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -361,7 +361,7 @@ public Foo(int i)
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupMethod
,
StandardGlyphItem
.
GlyphItemPublic
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"Foo"
)).
Single
(
t
=>
t
.
Kind
==
NavigateToItemKind
.
Method
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
"Foo(int)"
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
"[|Foo|](int)"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -378,7 +378,7 @@ static Foo()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupMethod
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"Foo"
)).
Single
(
t
=>
t
.
Kind
==
NavigateToItemKind
.
Method
&&
t
.
Name
!=
".ctor"
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
"Foo.static Foo()"
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"Foo"
,
"[|Foo|].static Foo()"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -407,7 +407,7 @@ public async Task FindPartialMethodDefinitionOnly()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupMethod
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"Bar"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"Bar"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
"Bar()"
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"Bar"
,
"[|Bar|]()"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Method
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -453,7 +453,7 @@ public async Task FindInterface()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupInterface
,
StandardGlyphItem
.
GlyphItemPublic
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"IF"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"IFoo"
,
MatchKind
.
Prefix
,
NavigateToItemKind
.
Interface
,
displayName
:
"IFoo"
);
VerifyNavigateToResultItem
(
item
,
"IFoo"
,
"[|IF|]oo"
,
MatchKind
.
Prefix
,
NavigateToItemKind
.
Interface
);
});
}
...
...
@@ -468,7 +468,7 @@ public async Task FindDelegateInNamespace()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupDelegate
,
StandardGlyphItem
.
GlyphItemFriend
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"DoStuff"
)).
Single
(
x
=>
x
.
Kind
!=
"Method"
);
VerifyNavigateToResultItem
(
item
,
"DoStuff"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Delegate
,
displayName
:
"DoStuff"
);
VerifyNavigateToResultItem
(
item
,
"DoStuff"
,
"[|DoStuff|]"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Delegate
);
});
}
...
...
@@ -485,7 +485,7 @@ class Foo
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupField
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"sqr"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"sqr"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Field
,
"sqr"
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
VerifyNavigateToResultItem
(
item
,
"sqr"
,
"[|sqr|]"
,
MatchKind
.
Exact
,
NavigateToItemKind
.
Field
,
$"
{
FeaturesResources
.
type_space
}
Foo"
);
});
}
...
...
@@ -640,7 +640,7 @@ public async Task TermSplittingTest5()
{
SetupVerifiableGlyph
(
StandardGlyphGroup
.
GlyphGroupField
,
StandardGlyphItem
.
GlyphItemPrivate
);
var
item
=
(
await
_aggregator
.
GetItemsAsync
(
"G_K_W"
)).
Single
();
VerifyNavigateToResultItem
(
item
,
"get_key_word"
,
MatchKind
.
Regular
,
NavigateToItemKind
.
Field
);
VerifyNavigateToResultItem
(
item
,
"get_key_word"
,
"[|g|]et[|_k|]ey[|_w|]ord"
,
MatchKind
.
Regular
,
NavigateToItemKind
.
Field
);
});
}
...
...
src/EditorFeatures/CSharpTest/NavigateTo/NavigateToTests.cs
浏览文件 @
244ab2ba
此差异已折叠。
点击以展开。
src/EditorFeatures/Core/Implementation/NavigateTo/AbstractNavigateToItemDisplay.cs
浏览文件 @
244ab2ba
...
...
@@ -6,7 +6,9 @@
using
System.Threading
;
using
Microsoft.CodeAnalysis.NavigateTo
;
using
Microsoft.CodeAnalysis.Navigation
;
using
Microsoft.CodeAnalysis.Text.Shared.Extensions
;
using
Microsoft.VisualStudio.Language.NavigateTo.Interfaces
;
using
Microsoft.VisualStudio.Text
;
using
Roslyn.Utilities
;
namespace
Microsoft.CodeAnalysis.Editor.Implementation.NavigateTo
...
...
@@ -130,5 +132,9 @@ public void PreviewItem()
previewService
.
PreviewItem
(
this
);
}
public
IReadOnlyList
<
Span
>
GetNameMatchRuns
(
string
searchValue
)
{
return
SearchResult
.
NameMatchSpans
.
NullToEmpty
().
SelectAsArray
(
ts
=>
ts
.
ToSpan
());
}
}
}
\ No newline at end of file
src/EditorFeatures/Next/NavigateTo/Dev15NavigateToHostVersionService.Dev15ItemDisplayFactory.cs
浏览文件 @
244ab2ba
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
Microsoft.CodeAnalysis.Editor.Implementation.NavigateTo
;
using
Microsoft.CodeAnalysis.Editor.Shared.Extensions
;
using
Microsoft.CodeAnalysis.NavigateTo
;
using
Microsoft.CodeAnalysis.Text.Shared.Extensions
;
using
Microsoft.VisualStudio.Imaging.Interop
;
using
Microsoft.VisualStudio.Language.NavigateTo.Interfaces
;
using
Microsoft.VisualStudio.Text
;
...
...
@@ -39,12 +36,6 @@ public Dev15NavigateToItemDisplay(INavigateToSearchResult searchResult)
public
IReadOnlyList
<
Span
>
GetAdditionalInformationMatchRuns
(
string
searchValue
)
=>
SpecializedCollections
.
EmptyReadOnlyList
<
Span
>();
public
IReadOnlyList
<
Span
>
GetNameMatchRuns
(
string
searchValue
)
{
var
result
=
SearchResult
.
NameMatchSpans
.
NullToEmpty
().
Select
(
ts
=>
ts
.
ToSpan
()).
ToList
();
return
result
;
}
}
}
}
\ No newline at end of file
src/EditorFeatures/TestUtilities/NavigateTo/AbstractNavigateToTests.cs
浏览文件 @
244ab2ba
...
...
@@ -2,6 +2,7 @@
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Immutable
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
System.Windows.Media
;
...
...
@@ -9,14 +10,17 @@
using
System.Xml.Linq
;
using
Microsoft.CodeAnalysis.Editor.Extensibility.Composition
;
using
Microsoft.CodeAnalysis.Editor.Implementation.NavigateTo
;
using
Microsoft.CodeAnalysis.Editor.Shared.Extensions
;
using
Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
;
using
Microsoft.CodeAnalysis.NavigateTo
;
using
Microsoft.CodeAnalysis.Shared.TestHooks
;
using
Microsoft.CodeAnalysis.Text
;
using
Microsoft.VisualStudio.Composition
;
using
Microsoft.VisualStudio.Language.Intellisense
;
using
Microsoft.VisualStudio.Language.NavigateTo.Interfaces
;
using
Moq
;
using
Roslyn.Test.EditorUtilities.NavigateTo
;
using
Roslyn.Test.Utilities
;
using
Xunit
;
namespace
Microsoft.CodeAnalysis.Editor.UnitTests.NavigateTo
...
...
@@ -102,8 +106,10 @@ protected void VerifyNavigateToResultItems(List<NavigateToItem> expecteditems, I
}
}
protected
void
VerifyNavigateToResultItem
(
NavigateToItem
result
,
string
name
,
MatchKind
matchKind
,
string
navigateToItemKind
,
string
displayName
=
null
,
string
additionalInfo
=
null
)
protected
void
VerifyNavigateToResultItem
(
NavigateToItem
result
,
string
name
,
string
displayName
,
MatchKind
matchKind
,
string
navigateToItemKind
,
string
additionalInfo
=
null
)
{
// Verify symbol information
Assert
.
Equal
(
name
,
result
.
Name
);
...
...
@@ -111,10 +117,15 @@ protected void VerifyNavigateToResultItems(List<NavigateToItem> expecteditems, I
Assert
.
Equal
(
this
.
Language
,
result
.
Language
);
Assert
.
Equal
(
navigateToItemKind
,
result
.
Kind
);
// Verify display
var
itemDisplay
=
result
.
DisplayFactory
.
CreateItemDisplay
(
result
);
MarkupTestFile
.
GetSpans
(
displayName
,
out
displayName
,
out
ImmutableArray
<
TextSpan
>
expectedDisplayNameSpans
);
Assert
.
Equal
(
displayName
??
name
,
itemDisplay
.
Name
);
var
itemDisplay
=
(
AbstractNavigateToItemDisplay
)
result
.
DisplayFactory
.
CreateItemDisplay
(
result
);
Assert
.
Equal
(
displayName
,
itemDisplay
.
Name
);
Assert
.
Equal
<
TextSpan
>(
expectedDisplayNameSpans
,
itemDisplay
.
GetNameMatchRuns
(
""
).
Select
(
s
=>
s
.
ToTextSpan
()).
ToImmutableArray
());
if
(
additionalInfo
!=
null
)
{
...
...
src/EditorFeatures/VisualBasicTest/NavigateTo/NavigateToTests.vb
浏览文件 @
244ab2ba
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录