Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
52f6acff
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,发现更多精彩内容 >>
提交
52f6acff
编写于
7月 25, 2016
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Inline method.
上级
01351b1d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
15 addition
and
20 deletion
+15
-20
src/EditorFeatures/Core/Implementation/FindReferences/DefinitionItem.cs
...ures/Core/Implementation/FindReferences/DefinitionItem.cs
+11
-12
src/VisualStudio/Core/Def/Implementation/Library/FindResults/LibraryManager_FindReferences.cs
...tion/Library/FindResults/LibraryManager_FindReferences.cs
+2
-2
src/VisualStudio/Core/Def/Implementation/Library/FindResults/TreeItems/DefinitionTreeItem.cs
...ation/Library/FindResults/TreeItems/DefinitionTreeItem.cs
+2
-6
未找到文件。
src/EditorFeatures/Core/Implementation/FindReferences/DefinitionItem.cs
浏览文件 @
52f6acff
...
...
@@ -12,8 +12,8 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.FindReferences
internal
sealed
class
DefinitionItem
{
/// <summary>
/// Descriptive tags from <see cref="CompletionTags"/>.
///
These tags may influence how the
item is displayed.
/// Descriptive tags from <see cref="CompletionTags"/>.
These tags may influence how the
/// item is displayed.
/// </summary>
public
ImmutableArray
<
string
>
Tags
{
get
;
}
...
...
@@ -23,21 +23,20 @@ internal sealed class DefinitionItem
public
ImmutableArray
<
TaggedText
>
DisplayParts
{
get
;
}
/// <summary>
/// The locations to present in the UI. A definition may have multiple locations
///
for cases
like partial types/members.
/// The locations to present in the UI. A definition may have multiple locations
for cases
/// like partial types/members.
/// </summary>
public
ImmutableArray
<
DefinitionLocation
>
Locations
{
get
;
}
/// <summary>
/// Whether or not this definition should be presented if we never found any
/// references to it. For example, when searching for a property, the Find
/// References enginer will cascade to the accessors in case any code specifically
/// called those accessors (can happen in cross language cases). However, in the
/// normal case where there were no calls specifically to the accessor, we would
/// not want to display them in the UI.
/// Whether or not this definition should be presented if we never found any references to
/// it. For example, when searching for a property, the FindReferences engine will cascade
/// to the accessors in case any code specifically called those accessors (can happen in
/// cross-language cases). However, in the normal case where there were no calls specifically
/// to the accessor, we would not want to display them in the UI.
///
/// For most definitions we will want to display them, even if no references were
///
found.
This property allows for this customization in behavior.
/// For most definitions we will want to display them, even if no references were
found.
/// This property allows for this customization in behavior.
/// </summary>
public
bool
DisplayIfNoReferences
{
get
;
}
...
...
src/VisualStudio/Core/Def/Implementation/Library/FindResults/LibraryManager_FindReferences.cs
浏览文件 @
52f6acff
...
...
@@ -60,8 +60,8 @@ public void PresentDefinitionsAndReferences(DefinitionsAndReferences definitions
// Each definition item may end up as several top nodes (because of partials).
// Add the references to the last item actually in the list.
var
definitionTreeItem
=
i
==
n
-
1
?
new
DefinitionTreeItem
(
definitionItem
,
location
)
:
new
DefinitionTreeItem
(
definitionItem
,
location
,
referenceItems
);
?
new
DefinitionTreeItem
(
definitionItem
,
location
,
referenceItems
)
:
new
DefinitionTreeItem
(
definitionItem
,
location
);
result
.
Add
(
definitionTreeItem
);
}
...
...
src/VisualStudio/Core/Def/Implementation/Library/FindResults/TreeItems/DefinitionTreeItem.cs
浏览文件 @
52f6acff
...
...
@@ -45,18 +45,14 @@ private string CreateDisplayText()
// results that tell us about their definition location, but not any additional
// reference. We don't want to say '0' references in that case as that can
// be misleading.
return
HasOrigination
()
var
hasOrigination
=
_definitionLocation
.
OriginationParts
.
Length
>
0
;
return
hasOrigination
?
$"[
{
_definitionLocation
.
OriginationParts
.
JoinText
()}
]
{
displayString
}
(
{
referenceCountDisplay
}
)"
:
referenceCount
>
0
?
$"
{
displayString
}
(
{
referenceCountDisplay
}
)"
:
displayString
;
}
private
bool
HasOrigination
()
{
return
_definitionLocation
.
OriginationParts
.
Length
>
0
;
}
public
override
int
GoToSource
()
{
return
_definitionLocation
.
TryNavigateTo
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录