Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
b4420494
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,发现更多精彩内容 >>
提交
b4420494
编写于
4月 22, 2017
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow callers to indicate if they want classified text produced or not for their definition items.
上级
b5386dea
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
37 addition
and
14 deletion
+37
-14
src/EditorFeatures/Core/FindUsages/AbstractFindUsagesService.ProgressAdapter.cs
...e/FindUsages/AbstractFindUsagesService.ProgressAdapter.cs
+2
-3
src/EditorFeatures/Core/FindUsages/AbstractFindUsagesService.cs
...itorFeatures/Core/FindUsages/AbstractFindUsagesService.cs
+2
-3
src/EditorFeatures/Core/FindUsages/IDefinitionsAndReferencesFactory.cs
...tures/Core/FindUsages/IDefinitionsAndReferencesFactory.cs
+30
-3
src/EditorFeatures/Core/GoToDefinition/GoToDefinitionHelpers.cs
...itorFeatures/Core/GoToDefinition/GoToDefinitionHelpers.cs
+1
-1
src/EditorFeatures/Core/Implementation/Peek/PeekableItemFactory.cs
...rFeatures/Core/Implementation/Peek/PeekableItemFactory.cs
+1
-2
src/VisualStudio/Core/Def/Implementation/Workspace/VisualStudioSymbolNavigationService.cs
...entation/Workspace/VisualStudioSymbolNavigationService.cs
+1
-2
未找到文件。
src/EditorFeatures/Core/FindUsages/AbstractFindUsagesService.ProgressAdapter.cs
浏览文件 @
b4420494
...
...
@@ -90,9 +90,8 @@ private async Task<DefinitionItem> GetDefinitionItemAsync(SymbolAndProjectId def
{
if
(!
_definitionToItem
.
TryGetValue
(
definition
.
Symbol
,
out
var
definitionItem
))
{
definitionItem
=
await
definition
.
Symbol
.
ToDefinitionItemAsync
(
_solution
,
includeHiddenLocations
:
false
,
cancellationToken
:
_context
.
CancellationToken
).
ConfigureAwait
(
false
);
definitionItem
=
await
definition
.
Symbol
.
ToClassifiedDefinitionItemAsync
(
_solution
,
includeHiddenLocations
:
false
,
cancellationToken
:
_context
.
CancellationToken
).
ConfigureAwait
(
false
);
_definitionToItem
[
definition
.
Symbol
]
=
definitionItem
;
}
...
...
src/EditorFeatures/Core/FindUsages/AbstractFindUsagesService.cs
浏览文件 @
b4420494
...
...
@@ -39,9 +39,8 @@ internal abstract partial class AbstractFindUsagesService : IFindUsagesService
var
project
=
tuple
.
Value
.
project
;
foreach
(
var
implementation
in
tuple
.
Value
.
implementations
)
{
var
definitionItem
=
await
implementation
.
ToDefinitionItemAsync
(
project
.
Solution
,
includeHiddenLocations
:
false
,
cancellationToken
:
cancellationToken
).
ConfigureAwait
(
false
);
var
definitionItem
=
await
implementation
.
ToClassifiedDefinitionItemAsync
(
project
.
Solution
,
includeHiddenLocations
:
false
,
cancellationToken
:
cancellationToken
).
ConfigureAwait
(
false
);
await
context
.
OnDefinitionFoundAsync
(
definitionItem
).
ConfigureAwait
(
false
);
}
}
...
...
src/EditorFeatures/Core/FindUsages/IDefinitionsAndReferencesFactory.cs
浏览文件 @
b4420494
...
...
@@ -37,10 +37,35 @@ internal class DefaultDefinitionsAndReferencesFactory : IDefinitionsAndReference
internal
static
class
DefinitionItemExtensions
{
public
static
async
Task
<
DefinitionItem
>
ToDefinitionItemAsync
(
public
static
DefinitionItem
ToNonClassifiedDefinitionItem
(
this
ISymbol
definition
,
Solution
solution
,
bool
includeHiddenLocations
)
{
// Because we're passing in 'false' for 'includeClassifiedSpans', this won't ever have
// to actually do async work. This is because the only asynchrony is when we are trying
// to compute the classified spans for the locations of the definition. So it's totally
// fine to pass in CancellationToken.None and block on the result.
return
ToDefinitionItemAsync
(
definition
,
solution
,
includeHiddenLocations
,
includeClassifiedSpans
:
false
,
cancellationToken
:
CancellationToken
.
None
).
Result
;
}
public
static
Task
<
DefinitionItem
>
ToClassifiedDefinitionItemAsync
(
this
ISymbol
definition
,
Solution
solution
,
bool
includeHiddenLocations
,
CancellationToken
cancellationToken
)
{
return
ToDefinitionItemAsync
(
definition
,
solution
,
includeHiddenLocations
,
includeClassifiedSpans
:
true
,
cancellationToken
:
cancellationToken
);
}
private
static
async
Task
<
DefinitionItem
>
ToDefinitionItemAsync
(
this
ISymbol
definition
,
Solution
solution
,
bool
includeHiddenLocations
,
bool
includeClassifiedSpans
,
CancellationToken
cancellationToken
)
{
// Ensure we're working with the original definition for the symbol. I.e. When we're
...
...
@@ -86,7 +111,9 @@ internal static class DefinitionItemExtensions
var
document
=
solution
.
GetDocument
(
location
.
SourceTree
);
if
(
document
!=
null
)
{
var
documentLocation
=
await
ClassifiedSpansAndHighlightSpan
.
GetClassifiedDocumentSpanAsync
(
var
documentLocation
=
!
includeClassifiedSpans
?
new
DocumentSpan
(
document
,
location
.
SourceSpan
)
:
await
ClassifiedSpansAndHighlightSpan
.
GetClassifiedDocumentSpanAsync
(
document
,
location
.
SourceSpan
,
cancellationToken
).
ConfigureAwait
(
false
);
sourceLocations
.
Add
(
documentLocation
);
...
...
src/EditorFeatures/Core/GoToDefinition/GoToDefinitionHelpers.cs
浏览文件 @
b4420494
...
...
@@ -61,7 +61,7 @@ internal static class GoToDefinitionHelpers
}
var
definitions
=
ArrayBuilder
<
DefinitionItem
>.
GetInstance
();
var
definitionItem
=
symbol
.
ToDefinitionItemAsync
(
var
definitionItem
=
symbol
.
To
Classified
DefinitionItemAsync
(
solution
,
includeHiddenLocations
:
true
,
cancellationToken
:
cancellationToken
).
WaitAndGetResult
(
cancellationToken
);
if
(
thirdPartyNavigationAllowed
)
...
...
src/EditorFeatures/Core/Implementation/Peek/PeekableItemFactory.cs
浏览文件 @
b4420494
...
...
@@ -60,8 +60,7 @@ private PeekableItemFactory(IMetadataAsSourceFileService metadataAsSourceFileSer
}
var
symbolNavigationService
=
solution
.
Workspace
.
Services
.
GetService
<
ISymbolNavigationService
>();
var
definitionItem
=
await
symbol
.
ToDefinitionItemAsync
(
solution
,
includeHiddenLocations
:
true
,
cancellationToken
:
cancellationToken
).
ConfigureAwait
(
false
);
var
definitionItem
=
symbol
.
ToNonClassifiedDefinitionItem
(
solution
,
includeHiddenLocations
:
true
);
if
(
symbolNavigationService
.
WouldNavigateToSymbol
(
definitionItem
,
solution
,
cancellationToken
,
...
...
src/VisualStudio/Core/Def/Implementation/Workspace/VisualStudioSymbolNavigationService.cs
浏览文件 @
b4420494
...
...
@@ -158,9 +158,8 @@ public bool TrySymbolNavigationNotify(ISymbol symbol, Solution solution, Cancell
ISymbol
symbol
,
Solution
solution
,
CancellationToken
cancellationToken
)
{
AssertIsForeground
();
var
definitionItem
=
symbol
.
ToDefinitionItemAsync
(
solution
,
includeHiddenLocations
:
true
,
cancellationToken
:
cancellationToken
).
WaitAndGetResult
(
cancellationToken
);
var
definitionItem
=
symbol
.
ToNonClassifiedDefinitionItem
(
solution
,
includeHiddenLocations
:
true
);
definitionItem
.
Properties
.
TryGetValue
(
DefinitionItem
.
RQNameKey1
,
out
var
rqName
);
if
(!
TryGetNavigationAPIRequiredArguments
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录