Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
313bfb28
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,发现更多精彩内容 >>
提交
313bfb28
编写于
4月 23, 2017
作者:
C
CyrusNajmabadi
提交者:
GitHub
4月 23, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18894 from CyrusNajmabadi/findRefsNavigation
FindRefs 'preview' versus 'navigate to source location'.
上级
40199132
b99ebd93
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
18 addition
and
14 deletion
+18
-14
src/EditorFeatures/Core/Host/IStreamingFindReferencesPresenter.cs
...orFeatures/Core/Host/IStreamingFindReferencesPresenter.cs
+2
-2
src/Features/Core/Portable/DocumentSpan.cs
src/Features/Core/Portable/DocumentSpan.cs
+2
-2
src/Features/Core/Portable/FindUsages/DefinitionItem.DocumentLocationDefinitionItem.cs
...ndUsages/DefinitionItem.DocumentLocationDefinitionItem.cs
+2
-2
src/Features/Core/Portable/FindUsages/DefinitionItem.cs
src/Features/Core/Portable/FindUsages/DefinitionItem.cs
+1
-1
src/VisualStudio/Core/Def/Implementation/FindReferences/VisualStudioDefinitionsAndReferencesFactory.cs
...References/VisualStudioDefinitionsAndReferencesFactory.cs
+1
-1
src/VisualStudio/Core/Def/Implementation/Library/FindResults/TreeItems/DefinitionTreeItem.cs
...ation/Library/FindResults/TreeItems/DefinitionTreeItem.cs
+1
-1
src/VisualStudio/Core/Def/Implementation/Workspace/VisualStudioDocumentNavigationService.cs
...tation/Workspace/VisualStudioDocumentNavigationService.cs
+5
-1
src/VisualStudio/Core/Next/FindReferences/FindReferencesTableControlEventProcessorProvider.cs
...ences/FindReferencesTableControlEventProcessorProvider.cs
+1
-1
src/VisualStudio/Core/Next/FindReferences/ISupportsNavigation.cs
...ualStudio/Core/Next/FindReferences/ISupportsNavigation.cs
+1
-1
src/VisualStudio/Core/Next/FindReferences/RoslynDefinitionBucket.cs
...Studio/Core/Next/FindReferences/RoslynDefinitionBucket.cs
+2
-2
未找到文件。
src/EditorFeatures/Core/Host/IStreamingFindReferencesPresenter.cs
浏览文件 @
313bfb28
...
...
@@ -53,7 +53,7 @@ internal static class IStreamingFindUsagesPresenterExtensions
var
externalItems
=
definitions
.
WhereAsArray
(
d
=>
d
.
IsExternal
);
foreach
(
var
item
in
externalItems
)
{
if
(
item
.
TryNavigateTo
(
workspace
))
if
(
item
.
TryNavigateTo
(
workspace
,
isPreview
:
true
))
{
return
true
;
}
...
...
@@ -69,7 +69,7 @@ internal static class IStreamingFindUsagesPresenterExtensions
nonExternalItems
[
0
].
SourceSpans
.
Length
<=
1
)
{
// There was only one location to navigate to. Just directly go to that location.
return
nonExternalItems
[
0
].
TryNavigateTo
(
workspace
);
return
nonExternalItems
[
0
].
TryNavigateTo
(
workspace
,
isPreview
:
true
);
}
if
(
presenter
!=
null
)
...
...
src/Features/Core/Portable/DocumentSpan.cs
浏览文件 @
313bfb28
...
...
@@ -52,13 +52,13 @@ public static bool CanNavigateTo(this DocumentSpan documentSpan)
return
service
.
CanNavigateToSpan
(
workspace
,
documentSpan
.
Document
.
Id
,
documentSpan
.
SourceSpan
);
}
public
static
bool
TryNavigateTo
(
this
DocumentSpan
documentSpan
)
public
static
bool
TryNavigateTo
(
this
DocumentSpan
documentSpan
,
bool
isPreview
)
{
var
solution
=
documentSpan
.
Document
.
Project
.
Solution
;
var
workspace
=
solution
.
Workspace
;
var
service
=
workspace
.
Services
.
GetService
<
IDocumentNavigationService
>();
return
service
.
TryNavigateToSpan
(
workspace
,
documentSpan
.
Document
.
Id
,
documentSpan
.
SourceSpan
,
options
:
solution
.
Options
.
WithChangedOption
(
NavigationOptions
.
PreferProvisionalTab
,
true
));
options
:
solution
.
Options
.
WithChangedOption
(
NavigationOptions
.
PreferProvisionalTab
,
isPreview
));
}
public
static
async
Task
<
bool
>
IsHiddenAsync
(
...
...
src/Features/Core/Portable/FindUsages/DefinitionItem.DocumentLocationDefinitionItem.cs
浏览文件 @
313bfb28
...
...
@@ -49,7 +49,7 @@ public override bool CanNavigateTo(Workspace workspace)
return
SourceSpans
[
0
].
CanNavigateTo
();
}
public
override
bool
TryNavigateTo
(
Workspace
workspace
)
public
override
bool
TryNavigateTo
(
Workspace
workspace
,
bool
isPreview
)
{
if
(
this
.
Properties
.
ContainsKey
(
NonNavigable
))
{
...
...
@@ -61,7 +61,7 @@ public override bool TryNavigateTo(Workspace workspace)
return
TryNavigateToMetadataSymbol
(
workspace
,
symbolKey
);
}
return
SourceSpans
[
0
].
TryNavigateTo
();
return
SourceSpans
[
0
].
TryNavigateTo
(
isPreview
);
}
private
bool
CanNavigateToMetadataSymbol
(
Workspace
workspace
,
string
symbolKey
)
...
...
src/Features/Core/Portable/FindUsages/DefinitionItem.cs
浏览文件 @
313bfb28
...
...
@@ -116,7 +116,7 @@ internal abstract partial class DefinitionItem
}
public
abstract
bool
CanNavigateTo
(
Workspace
workspace
);
public
abstract
bool
TryNavigateTo
(
Workspace
workspace
);
public
abstract
bool
TryNavigateTo
(
Workspace
workspace
,
bool
isPreview
);
public
static
DefinitionItem
Create
(
ImmutableArray
<
string
>
tags
,
...
...
src/VisualStudio/Core/Def/Implementation/FindReferences/VisualStudioDefinitionsAndReferencesFactory.cs
浏览文件 @
313bfb28
...
...
@@ -108,7 +108,7 @@ private class ExternalDefinitionItem : DefinitionItem
public
override
bool
CanNavigateTo
(
Workspace
workspace
)
=>
true
;
public
override
bool
TryNavigateTo
(
Workspace
workspace
)
public
override
bool
TryNavigateTo
(
Workspace
workspace
,
bool
isPreview
)
{
return
TryOpenFile
()
&&
TryNavigateToPosition
();
}
...
...
src/VisualStudio/Core/Def/Implementation/Library/FindResults/TreeItems/DefinitionTreeItem.cs
浏览文件 @
313bfb28
...
...
@@ -52,7 +52,7 @@ private string CreateDisplayText()
public
override
int
GoToSource
()
{
return
_definitionItem
.
TryNavigateTo
(
_workspace
)
return
_definitionItem
.
TryNavigateTo
(
_workspace
,
isPreview
:
true
)
?
VSConstants
.
S_OK
:
VSConstants
.
E_FAIL
;
}
...
...
src/VisualStudio/Core/Def/Implementation/Workspace/VisualStudioDocumentNavigationService.cs
浏览文件 @
313bfb28
...
...
@@ -275,7 +275,11 @@ private static Document OpenDocument(Workspace workspace, DocumentId documentId,
{
if
(
options
.
GetOption
(
NavigationOptions
.
PreferProvisionalTab
))
{
using
(
NewDocumentStateScope
ndss
=
new
NewDocumentStateScope
(
__VSNEWDOCUMENTSTATE
.
NDS_Provisional
,
VSConstants
.
NewDocumentStateReason
.
Navigation
))
// If we're just opening the provisional tab, then do not "activate" the document
// (i.e. don't give it focus). This way if a user is just arrowing through a set
// of FindAllReferences results, they don't have their cursor placed into the document.
var
state
=
__VSNEWDOCUMENTSTATE
.
NDS_Provisional
|
__VSNEWDOCUMENTSTATE
.
NDS_NoActivate
;
using
(
var
scope
=
new
NewDocumentStateScope
(
state
,
VSConstants
.
NewDocumentStateReason
.
Navigation
))
{
workspace
.
OpenDocument
(
documentId
);
}
...
...
src/VisualStudio/Core/Next/FindReferences/FindReferencesTableControlEventProcessorProvider.cs
浏览文件 @
313bfb28
...
...
@@ -33,7 +33,7 @@ public override void PreprocessNavigate(ITableEntryHandle entry, TableEntryNavig
var
supportsNavigation
=
entry
.
Identity
as
ISupportsNavigation
;
if
(
supportsNavigation
!=
null
)
{
if
(
supportsNavigation
.
TryNavigateTo
())
if
(
supportsNavigation
.
TryNavigateTo
(
e
.
IsPreview
))
{
e
.
Handled
=
true
;
return
;
...
...
src/VisualStudio/Core/Next/FindReferences/ISupportsNavigation.cs
浏览文件 @
313bfb28
...
...
@@ -4,6 +4,6 @@ namespace Microsoft.VisualStudio.LanguageServices.FindUsages
{
internal
interface
ISupportsNavigation
{
bool
TryNavigateTo
();
bool
TryNavigateTo
(
bool
isPreview
);
}
}
\ No newline at end of file
src/VisualStudio/Core/Next/FindReferences/RoslynDefinitionBucket.cs
浏览文件 @
313bfb28
...
...
@@ -34,8 +34,8 @@ private class RoslynDefinitionBucket : DefinitionBucket, ISupportsNavigation
DefinitionItem
=
definitionItem
;
}
public
bool
TryNavigateTo
()
=>
DefinitionItem
.
TryNavigateTo
(
_presenter
.
_workspace
);
public
bool
TryNavigateTo
(
bool
isPreview
)
=>
DefinitionItem
.
TryNavigateTo
(
_presenter
.
_workspace
,
isPreview
);
public
override
bool
TryGetValue
(
string
key
,
out
object
content
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录