Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
f7446f70
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,发现更多精彩内容 >>
提交
f7446f70
编写于
4月 20, 2017
作者:
C
CyrusNajmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow properties to be passed with DefinitionItems for FAR.
上级
d9254bc1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
59 addition
and
14 deletion
+59
-14
src/Features/Core/Portable/FindUsages/DefinitionItem.DocumentLocationDefinitionItem.cs
...ndUsages/DefinitionItem.DocumentLocationDefinitionItem.cs
+3
-2
src/Features/Core/Portable/FindUsages/DefinitionItem.NonNavigatingDefinitionItem.cs
.../FindUsages/DefinitionItem.NonNavigatingDefinitionItem.cs
+3
-2
src/Features/Core/Portable/FindUsages/DefinitionItem.SymbolDefinitionItem.cs
...ortable/FindUsages/DefinitionItem.SymbolDefinitionItem.cs
+2
-0
src/Features/Core/Portable/FindUsages/DefinitionItem.cs
src/Features/Core/Portable/FindUsages/DefinitionItem.cs
+42
-6
src/Features/Core/Portable/FindUsages/IDefinitionsAndReferencesFactory.cs
...e/Portable/FindUsages/IDefinitionsAndReferencesFactory.cs
+4
-3
src/VisualStudio/Core/Def/Implementation/FindReferences/VisualStudioDefinitionsAndReferencesFactory.cs
...References/VisualStudioDefinitionsAndReferencesFactory.cs
+5
-1
未找到文件。
src/Features/Core/Portable/FindUsages/DefinitionItem.DocumentLocationDefinitionItem.cs
浏览文件 @
f7446f70
...
...
@@ -20,10 +20,11 @@ internal sealed class DocumentLocationDefinitionItem : DefinitionItem
ImmutableArray
<
TaggedText
>
displayParts
,
ImmutableArray
<
TaggedText
>
nameDisplayParts
,
ImmutableArray
<
DocumentSpan
>
sourceSpans
,
ImmutableDictionary
<
string
,
string
>
properties
,
bool
displayIfNoReferences
)
:
base
(
tags
,
displayParts
,
nameDisplayParts
,
ImmutableArray
.
Create
(
new
TaggedText
(
TextTags
.
Text
,
sourceSpans
[
0
].
Document
.
Project
.
Name
)),
sourceSpan
s
,
displayIfNoReferences
)
ImmutableArray
.
Create
(
new
TaggedText
(
TextTags
.
Text
,
sourceSpans
[
0
].
Document
.
Project
.
Name
)),
sourceSpans
,
propertie
s
,
displayIfNoReferences
)
{
}
...
...
src/Features/Core/Portable/FindUsages/DefinitionItem.NonNavigatingDefinitionItem.cs
浏览文件 @
f7446f70
...
...
@@ -19,10 +19,11 @@ private sealed class NonNavigatingDefinitionItem : DefinitionItem
ImmutableArray
<
string
>
tags
,
ImmutableArray
<
TaggedText
>
displayParts
,
ImmutableArray
<
TaggedText
>
originationParts
,
ImmutableDictionary
<
string
,
string
>
properties
,
bool
displayIfNoReferences
)
:
base
(
tags
,
displayParts
,
ImmutableArray
<
TaggedText
>.
Empty
,
originationParts
,
ImmutableArray
<
DocumentSpan
>.
Empty
,
displayIfNoReferences
)
originationParts
,
ImmutableArray
<
DocumentSpan
>.
Empty
,
properties
,
displayIfNoReferences
)
{
}
...
...
src/Features/Core/Portable/FindUsages/DefinitionItem.SymbolDefinitionItem.cs
浏览文件 @
f7446f70
...
...
@@ -31,11 +31,13 @@ private sealed class MetadataDefinitionItem : DefinitionItem
ImmutableArray
<
string
>
tags
,
ImmutableArray
<
TaggedText
>
displayParts
,
ImmutableArray
<
TaggedText
>
nameDisplayParts
,
ImmutableDictionary
<
string
,
string
>
properties
,
bool
displayIfNoReferences
,
Solution
solution
,
ISymbol
definition
)
:
base
(
tags
,
displayParts
,
nameDisplayParts
,
GetOriginationParts
(
definition
),
ImmutableArray
<
DocumentSpan
>.
Empty
,
properties
,
displayIfNoReferences
)
{
_workspace
=
solution
.
Workspace
;
...
...
src/Features/Core/Portable/FindUsages/DefinitionItem.cs
浏览文件 @
f7446f70
...
...
@@ -24,6 +24,12 @@ internal abstract partial class DefinitionItem
/// </summary>
public
ImmutableArray
<
string
>
Tags
{
get
;
}
/// <summary>
/// Additional properties that can be attached to the definition for clients that want to
/// keep track of additional data.
/// </summary>
public
ImmutableDictionary
<
string
,
string
>
Properties
{
get
;
}
/// <summary>
/// The DisplayParts just for the name of this definition. Generally used only for
/// error messages.
...
...
@@ -66,15 +72,17 @@ internal abstract partial class DefinitionItem
ImmutableArray
<
string
>
tags
,
ImmutableArray
<
TaggedText
>
displayParts
,
ImmutableArray
<
TaggedText
>
nameDisplayParts
,
ImmutableArray
<
TaggedText
>
originationParts
=
default
(
ImmutableArray
<
TaggedText
>),
ImmutableArray
<
DocumentSpan
>
sourceSpans
=
default
(
ImmutableArray
<
DocumentSpan
>),
bool
displayIfNoReferences
=
true
)
ImmutableArray
<
TaggedText
>
originationParts
,
ImmutableArray
<
DocumentSpan
>
sourceSpans
,
ImmutableDictionary
<
string
,
string
>
properties
,
bool
displayIfNoReferences
)
{
Tags
=
tags
;
DisplayParts
=
displayParts
;
NameDisplayParts
=
nameDisplayParts
.
IsDefaultOrEmpty
?
displayParts
:
nameDisplayParts
;
OriginationParts
=
originationParts
.
NullToEmpty
();
SourceSpans
=
sourceSpans
.
NullToEmpty
();
Properties
=
properties
;
DisplayIfNoReferences
=
displayIfNoReferences
;
}
...
...
@@ -93,11 +101,25 @@ internal abstract partial class DefinitionItem
nameDisplayParts
,
displayIfNoReferences
);
}
// Kept around for binary compat with F#/TypeScript.
public
static
DefinitionItem
Create
(
ImmutableArray
<
string
>
tags
,
ImmutableArray
<
TaggedText
>
displayParts
,
ImmutableArray
<
DocumentSpan
>
sourceSpans
,
ImmutableArray
<
TaggedText
>
nameDisplayParts
,
bool
displayIfNoReferences
)
{
return
Create
(
tags
,
displayParts
,
sourceSpans
,
nameDisplayParts
,
properties
:
null
,
displayIfNoReferences
:
displayIfNoReferences
);
}
public
static
DefinitionItem
Create
(
ImmutableArray
<
string
>
tags
,
ImmutableArray
<
TaggedText
>
displayParts
,
ImmutableArray
<
DocumentSpan
>
sourceSpans
,
ImmutableArray
<
TaggedText
>
nameDisplayParts
=
default
(
ImmutableArray
<
TaggedText
>),
ImmutableDictionary
<
string
,
string
>
properties
=
null
,
bool
displayIfNoReferences
=
true
)
{
if
(
sourceSpans
.
Length
==
0
)
...
...
@@ -106,7 +128,7 @@ internal abstract partial class DefinitionItem
}
return
new
DocumentLocationDefinitionItem
(
tags
,
displayParts
,
nameDisplayParts
,
sourceSpans
,
displayIfNoReferences
);
tags
,
displayParts
,
nameDisplayParts
,
sourceSpans
,
properties
,
displayIfNoReferences
);
}
internal
static
DefinitionItem
CreateMetadataDefinition
(
...
...
@@ -114,21 +136,35 @@ internal abstract partial class DefinitionItem
ImmutableArray
<
TaggedText
>
displayParts
,
ImmutableArray
<
TaggedText
>
nameDisplayParts
,
Solution
solution
,
ISymbol
symbol
,
ImmutableDictionary
<
string
,
string
>
properties
=
null
,
bool
displayIfNoReferences
=
true
)
{
return
new
MetadataDefinitionItem
(
tags
,
displayParts
,
nameDisplayParts
,
tags
,
displayParts
,
nameDisplayParts
,
properties
,
displayIfNoReferences
,
solution
,
symbol
);
}
// Kept around for binary compat with F#/TypeScript.
public
static
DefinitionItem
CreateNonNavigableItem
(
ImmutableArray
<
string
>
tags
,
ImmutableArray
<
TaggedText
>
displayParts
,
ImmutableArray
<
TaggedText
>
originationParts
,
bool
displayIfNoReferences
)
{
return
CreateNonNavigableItem
(
tags
,
displayParts
,
originationParts
,
properties
:
null
,
displayIfNoReferences
:
displayIfNoReferences
);
}
public
static
DefinitionItem
CreateNonNavigableItem
(
ImmutableArray
<
string
>
tags
,
ImmutableArray
<
TaggedText
>
displayParts
,
ImmutableArray
<
TaggedText
>
originationParts
=
default
(
ImmutableArray
<
TaggedText
>),
ImmutableDictionary
<
string
,
string
>
properties
=
null
,
bool
displayIfNoReferences
=
true
)
{
return
new
NonNavigatingDefinitionItem
(
tags
,
displayParts
,
originationParts
,
displayIfNoReferences
);
tags
,
displayParts
,
originationParts
,
properties
,
displayIfNoReferences
);
}
internal
static
ImmutableArray
<
TaggedText
>
GetOriginationParts
(
ISymbol
symbol
)
...
...
src/Features/Core/Portable/FindUsages/IDefinitionsAndReferencesFactory.cs
浏览文件 @
f7446f70
...
...
@@ -180,6 +180,7 @@ internal static class DefinitionItemExtensions
showMetadataSymbolsWithoutReferences
:
false
);
var
sourceLocations
=
ArrayBuilder
<
DocumentSpan
>.
GetInstance
();
ImmutableDictionary
<
string
,
string
>
properties
=
null
;
// If it's a namespace, don't create any normal location. Namespaces
// come from many different sources, but we'll only show a single
...
...
@@ -192,7 +193,7 @@ internal static class DefinitionItemExtensions
{
return
DefinitionItem
.
CreateMetadataDefinition
(
tags
,
displayParts
,
nameDisplayParts
,
solution
,
definition
,
displayIfNoReferences
);
definition
,
properties
,
displayIfNoReferences
);
}
else
if
(
location
.
IsInSource
)
{
...
...
@@ -230,12 +231,12 @@ internal static class DefinitionItemExtensions
return
DefinitionItem
.
CreateNonNavigableItem
(
tags
,
displayParts
,
DefinitionItem
.
GetOriginationParts
(
definition
),
displayIfNoReferences
);
properties
,
displayIfNoReferences
);
}
return
DefinitionItem
.
Create
(
tags
,
displayParts
,
sourceLocations
.
ToImmutableAndFree
(),
nameDisplayParts
,
displayIfNoReferences
);
nameDisplayParts
,
properties
,
displayIfNoReferences
);
}
public
static
SourceReferenceItem
TryCreateSourceReferenceItem
(
...
...
src/VisualStudio/Core/Def/Implementation/FindReferences/VisualStudioDefinitionsAndReferencesFactory.cs
浏览文件 @
f7446f70
...
...
@@ -93,7 +93,11 @@ private class ExternalDefinitionItem : DefinitionItem
string
filePath
,
int
lineNumber
,
int
charOffset
)
:
base
(
tags
,
displayParts
,
ImmutableArray
<
TaggedText
>.
Empty
)
:
base
(
tags
,
displayParts
,
ImmutableArray
<
TaggedText
>.
Empty
,
originationParts
:
default
(
ImmutableArray
<
TaggedText
>),
sourceSpans
:
default
(
ImmutableArray
<
DocumentSpan
>),
properties
:
null
,
displayIfNoReferences
:
true
)
{
_serviceProvider
=
serviceProvider
;
_filePath
=
filePath
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录