Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
4f147f5b
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,发现更多精彩内容 >>
提交
4f147f5b
编写于
2月 09, 2015
作者:
B
Brett Forsgren
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #332 from brettfo/navigateto-cancellation
Remove cancellation token from NavigateTo
上级
4c837aa4
03d49f8a
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
10 addition
and
9 deletion
+10
-9
src/EditorFeatures/Core/Extensibility/Navigation/NavigableItemFactory.DeclaredSymbolNavigableItem.cs
...ation/NavigableItemFactory.DeclaredSymbolNavigableItem.cs
+4
-2
src/EditorFeatures/Core/Extensibility/Navigation/NavigableItemFactory.cs
...res/Core/Extensibility/Navigation/NavigableItemFactory.cs
+2
-3
src/EditorFeatures/Core/Implementation/NavigateTo/AbstractNavigateToSearchService.SearchResult.cs
...avigateTo/AbstractNavigateToSearchService.SearchResult.cs
+1
-1
src/EditorFeatures/Core/Implementation/NavigateTo/AbstractNavigateToSearchService.cs
...lementation/NavigateTo/AbstractNavigateToSearchService.cs
+3
-3
未找到文件。
src/EditorFeatures/Core/Extensibility/Navigation/NavigableItemFactory.DeclaredSymbolNavigableItem.cs
浏览文件 @
4f147f5b
...
...
@@ -23,12 +23,14 @@ internal class DeclaredSymbolNavigableItem : INavigableItem
private
readonly
Lazy
<
string
>
_lazyDisplayName
;
private
readonly
Lazy
<
ISymbol
>
_lazySymbol
;
public
DeclaredSymbolNavigableItem
(
Document
document
,
DeclaredSymbolInfo
declaredSymbolInfo
,
CancellationToken
cancellationToken
)
public
DeclaredSymbolNavigableItem
(
Document
document
,
DeclaredSymbolInfo
declaredSymbolInfo
)
{
Document
=
document
;
_declaredSymbolInfo
=
declaredSymbolInfo
;
_lazySymbol
=
new
Lazy
<
ISymbol
>(()
=>
declaredSymbolInfo
.
GetSymbolAsync
(
document
,
cancellationToken
).
ConfigureAwait
(
false
).
GetAwaiter
().
GetResult
());
// Cancellation isn't supported when computing the various properties that depend on the symbol, hence
// CancellationToken.None.
_lazySymbol
=
new
Lazy
<
ISymbol
>(()
=>
declaredSymbolInfo
.
GetSymbolAsync
(
document
,
CancellationToken
.
None
).
ConfigureAwait
(
false
).
GetAwaiter
().
GetResult
());
_lazyDisplayName
=
new
Lazy
<
string
>(()
=>
{
if
(
Symbol
==
null
)
...
...
src/EditorFeatures/Core/Extensibility/Navigation/NavigableItemFactory.cs
浏览文件 @
4f147f5b
...
...
@@ -2,7 +2,6 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading
;
using
Microsoft.CodeAnalysis.FindSymbols
;
using
Microsoft.CodeAnalysis.GeneratedCodeRecognition
;
using
Microsoft.CodeAnalysis.Shared.Extensions
;
...
...
@@ -17,9 +16,9 @@ public static INavigableItem GetItemFromSymbolLocation(Solution solution, ISymbo
return
new
SymbolLocationNavigableItem
(
solution
,
symbol
,
location
);
}
public
static
INavigableItem
GetItemFromDeclaredSymbolInfo
(
DeclaredSymbolInfo
declaredSymbolInfo
,
Document
document
,
CancellationToken
cancellationToken
)
public
static
INavigableItem
GetItemFromDeclaredSymbolInfo
(
DeclaredSymbolInfo
declaredSymbolInfo
,
Document
document
)
{
return
new
DeclaredSymbolNavigableItem
(
document
,
declaredSymbolInfo
,
cancellationToken
);
return
new
DeclaredSymbolNavigableItem
(
document
,
declaredSymbolInfo
);
}
public
static
IEnumerable
<
INavigableItem
>
GetItemsfromPreferredSourceLocations
(
Solution
solution
,
ISymbol
symbol
)
...
...
src/EditorFeatures/Core/Implementation/NavigateTo/AbstractNavigateToSearchService.SearchResult.cs
浏览文件 @
4f147f5b
...
...
@@ -41,7 +41,7 @@ public SearchResult(Document document, DeclaredSymbolInfo declaredSymbolInfo, st
var
declaredNavigableItem
=
navigableItem
as
NavigableItemFactory
.
DeclaredSymbolNavigableItem
;
Debug
.
Assert
(
declaredNavigableItem
!=
null
);
_lazySummary
=
new
Lazy
<
string
>(()
=>
declaredNavigableItem
.
Symbol
.
GetDocumentationComment
()?.
SummaryText
);
_lazySummary
=
new
Lazy
<
string
>(()
=>
declaredNavigableItem
.
Symbol
?
.
GetDocumentationComment
()?.
SummaryText
);
_lazyAdditionalInfo
=
new
Lazy
<
string
>(()
=>
{
switch
(
declaredSymbolInfo
.
Kind
)
...
...
src/EditorFeatures/Core/Implementation/NavigateTo/AbstractNavigateToSearchService.cs
浏览文件 @
4f147f5b
...
...
@@ -17,10 +17,10 @@ internal abstract partial class AbstractNavigateToSearchService : INavigateToSea
public
async
Task
<
IEnumerable
<
INavigateToSearchResult
>>
SearchProjectAsync
(
Project
project
,
string
searchPattern
,
CancellationToken
cancellationToken
)
{
var
results
=
await
NavigateToSymbolFinder
.
FindNavigableDeclaredSymbolInfos
(
project
,
searchPattern
,
cancellationToken
).
ConfigureAwait
(
false
);
return
results
.
Select
(
r
=>
ConvertResult
(
r
,
cancellationToken
));
return
results
.
Select
(
r
=>
ConvertResult
(
r
));
}
private
INavigateToSearchResult
ConvertResult
(
ValueTuple
<
DeclaredSymbolInfo
,
Document
,
IEnumerable
<
PatternMatch
>>
result
,
CancellationToken
cancellationToken
)
private
INavigateToSearchResult
ConvertResult
(
ValueTuple
<
DeclaredSymbolInfo
,
Document
,
IEnumerable
<
PatternMatch
>>
result
)
{
var
declaredSymbolInfo
=
result
.
Item1
;
var
document
=
result
.
Item2
;
...
...
@@ -31,7 +31,7 @@ private INavigateToSearchResult ConvertResult(ValueTuple<DeclaredSymbolInfo, Doc
// case sensitive.
var
isCaseSensitive
=
matches
.
All
(
m
=>
m
.
IsCaseSensitive
);
var
kind
=
GetItemKind
(
declaredSymbolInfo
);
var
navigableItem
=
NavigableItemFactory
.
GetItemFromDeclaredSymbolInfo
(
declaredSymbolInfo
,
document
,
cancellationToken
);
var
navigableItem
=
NavigableItemFactory
.
GetItemFromDeclaredSymbolInfo
(
declaredSymbolInfo
,
document
);
return
new
SearchResult
(
document
,
declaredSymbolInfo
,
kind
,
matchKind
,
isCaseSensitive
,
navigableItem
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录