Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
2f112131
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,发现更多精彩内容 >>
提交
2f112131
编写于
4月 21, 2017
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FindRefs 'preview' versus 'navigate to source location'.
上级
d01211ef
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
20 addition
and
16 deletion
+20
-16
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
+1
-1
src/Features/Core/Portable/FindUsages/DefinitionItem.NonNavigatingDefinitionItem.cs
.../FindUsages/DefinitionItem.NonNavigatingDefinitionItem.cs
+1
-1
src/Features/Core/Portable/FindUsages/DefinitionItem.SymbolDefinitionItem.cs
...ortable/FindUsages/DefinitionItem.SymbolDefinitionItem.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
浏览文件 @
2f112131
...
...
@@ -53,7 +53,7 @@ internal static class IStreamingFindUsagesPresenterExtensions
var
externalItems
=
definitions
.
WhereAsArray
(
d
=>
d
.
IsExternal
);
foreach
(
var
item
in
externalItems
)
{
if
(
item
.
TryNavigateTo
())
if
(
item
.
TryNavigateTo
(
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
();
return
nonExternalItems
[
0
].
TryNavigateTo
(
isPreview
:
true
);
}
if
(
presenter
!=
null
)
...
...
src/Features/Core/Portable/DocumentSpan.cs
浏览文件 @
2f112131
...
...
@@ -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
浏览文件 @
2f112131
...
...
@@ -29,7 +29,7 @@ internal sealed class DocumentLocationDefinitionItem : DefinitionItem
}
public
override
bool
CanNavigateTo
()
=>
SourceSpans
[
0
].
CanNavigateTo
();
public
override
bool
TryNavigateTo
(
)
=>
SourceSpans
[
0
].
TryNavigateTo
(
);
public
override
bool
TryNavigateTo
(
bool
isPreview
)
=>
SourceSpans
[
0
].
TryNavigateTo
(
isPreview
);
}
}
}
\ No newline at end of file
src/Features/Core/Portable/FindUsages/DefinitionItem.NonNavigatingDefinitionItem.cs
浏览文件 @
2f112131
...
...
@@ -28,7 +28,7 @@ private sealed class NonNavigatingDefinitionItem : DefinitionItem
}
public
override
bool
CanNavigateTo
()
=>
false
;
public
override
bool
TryNavigateTo
()
=>
false
;
public
override
bool
TryNavigateTo
(
bool
isPreview
)
=>
false
;
}
}
}
\ No newline at end of file
src/Features/Core/Portable/FindUsages/DefinitionItem.SymbolDefinitionItem.cs
浏览文件 @
2f112131
...
...
@@ -48,11 +48,11 @@ private sealed class MetadataDefinitionItem : DefinitionItem
public
override
bool
CanNavigateTo
()
=>
TryNavigateTo
((
symbol
,
project
,
service
)
=>
true
);
public
override
bool
TryNavigateTo
()
public
override
bool
TryNavigateTo
(
bool
isPreview
)
{
return
TryNavigateTo
((
symbol
,
project
,
service
)
=>
service
.
TryNavigateToSymbol
(
symbol
,
project
,
project
.
Solution
.
Options
.
WithChangedOption
(
NavigationOptions
.
PreferProvisionalTab
,
true
)));
symbol
,
project
,
project
.
Solution
.
Options
.
WithChangedOption
(
NavigationOptions
.
PreferProvisionalTab
,
isPreview
)));
}
private
bool
TryNavigateTo
(
Func
<
ISymbol
,
Project
,
ISymbolNavigationService
,
bool
>
action
)
...
...
src/Features/Core/Portable/FindUsages/DefinitionItem.cs
浏览文件 @
2f112131
...
...
@@ -87,7 +87,7 @@ internal abstract partial class DefinitionItem
}
public
abstract
bool
CanNavigateTo
();
public
abstract
bool
TryNavigateTo
();
public
abstract
bool
TryNavigateTo
(
bool
isPreview
);
public
static
DefinitionItem
Create
(
ImmutableArray
<
string
>
tags
,
...
...
src/VisualStudio/Core/Def/Implementation/FindReferences/VisualStudioDefinitionsAndReferencesFactory.cs
浏览文件 @
2f112131
...
...
@@ -108,7 +108,7 @@ private class ExternalDefinitionItem : DefinitionItem
public
override
bool
CanNavigateTo
()
=>
true
;
public
override
bool
TryNavigateTo
()
public
override
bool
TryNavigateTo
(
bool
isPreview
)
{
return
TryOpenFile
()
&&
TryNavigateToPosition
();
}
...
...
src/VisualStudio/Core/Def/Implementation/Library/FindResults/TreeItems/DefinitionTreeItem.cs
浏览文件 @
2f112131
...
...
@@ -49,7 +49,7 @@ private string CreateDisplayText()
public
override
int
GoToSource
()
{
return
_definitionItem
.
TryNavigateTo
()
return
_definitionItem
.
TryNavigateTo
(
isPreview
:
true
)
?
VSConstants
.
S_OK
:
VSConstants
.
E_FAIL
;
}
...
...
src/VisualStudio/Core/Def/Implementation/Workspace/VisualStudioDocumentNavigationService.cs
浏览文件 @
2f112131
...
...
@@ -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
浏览文件 @
2f112131
...
...
@@ -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
浏览文件 @
2f112131
...
...
@@ -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
浏览文件 @
2f112131
...
...
@@ -34,9 +34,9 @@ private class RoslynDefinitionBucket : DefinitionBucket, ISupportsNavigation
DefinitionItem
=
definitionItem
;
}
public
bool
TryNavigateTo
()
public
bool
TryNavigateTo
(
bool
isPreview
)
{
return
DefinitionItem
.
TryNavigateTo
();
return
DefinitionItem
.
TryNavigateTo
(
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录