Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
d14741f0
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,发现更多精彩内容 >>
提交
d14741f0
编写于
4月 07, 2017
作者:
C
CyrusNajmabadi
提交者:
GitHub
4月 07, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18520 from Pilchie/Fix18382-FARWebGrouping
Use the project display name in FAR to support grouping
上级
5015aaa7
b5395100
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
40 addition
and
14 deletion
+40
-14
src/VisualStudio/Core/Def/Implementation/ProjectSystem/AbstractProject.cs
.../Core/Def/Implementation/ProjectSystem/AbstractProject.cs
+5
-2
src/VisualStudio/Core/Def/Implementation/ProjectSystem/IVisualStudioHostProject.cs
.../Implementation/ProjectSystem/IVisualStudioHostProject.cs
+15
-0
src/VisualStudio/Core/Def/Implementation/ProjectSystem/MiscellaneousFilesWorkspace.HostProject.cs
.../ProjectSystem/MiscellaneousFilesWorkspace.HostProject.cs
+2
-1
src/VisualStudio/Core/Next/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs
...nces/Contexts/AbstractTableDataSourceFindUsagesContext.cs
+8
-5
src/VisualStudio/Core/Next/FindReferences/Contexts/WithoutReferencesFindUsagesContext.cs
...References/Contexts/WithoutReferencesFindUsagesContext.cs
+2
-2
src/VisualStudio/Core/Next/FindReferences/Entries/AbstractDocumentSpanEntry.cs
.../Next/FindReferences/Entries/AbstractDocumentSpanEntry.cs
+4
-2
src/VisualStudio/Core/Next/FindReferences/Entries/DefinitionItemEntry.cs
...o/Core/Next/FindReferences/Entries/DefinitionItemEntry.cs
+2
-1
src/VisualStudio/Core/Next/FindReferences/Entries/DocumentSpanEntry.cs
...dio/Core/Next/FindReferences/Entries/DocumentSpanEntry.cs
+2
-1
未找到文件。
src/VisualStudio/Core/Def/Implementation/ProjectSystem/AbstractProject.cs
浏览文件 @
d14741f0
...
...
@@ -122,7 +122,10 @@ internal abstract partial class AbstractProject : ForegroundThreadAffinitizedObj
ContentTypeRegistryService
=
componentModel
.
GetService
<
IContentTypeRegistryService
>();
this
.
RunningDocumentTable
=
(
IVsRunningDocumentTable4
)
serviceProvider
.
GetService
(
typeof
(
SVsRunningDocumentTable
));
this
.
DisplayName
=
projectSystemName
;
var
displayName
=
hierarchy
!=
null
&&
hierarchy
.
TryGetName
(
out
var
name
)
?
name
:
projectSystemName
;
this
.
DisplayName
=
displayName
;
this
.
ProjectTracker
=
projectTracker
;
ProjectSystemName
=
projectSystemName
;
...
...
@@ -133,7 +136,7 @@ internal abstract partial class AbstractProject : ForegroundThreadAffinitizedObj
// Set the default value for last design time build result to be true, until the project system lets us know that it failed.
LastDesignTimeBuildSucceeded
=
true
;
UpdateProjectDisplayNameAndFilePath
(
projectSystem
Name
,
projectFilePath
);
UpdateProjectDisplayNameAndFilePath
(
display
Name
,
projectFilePath
);
if
(
ProjectFilePath
!=
null
)
{
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/IVisualStudioHostProject.cs
浏览文件 @
d14741f0
...
...
@@ -22,6 +22,21 @@ internal interface IVisualStudioHostProject
Guid
Guid
{
get
;
}
Workspace
Workspace
{
get
;
}
/// <summary>
/// The public display name of the project. This name is not unique and may be shared
/// between multiple projects, especially in cases like Venus where the intellisense
/// projects will match the name of their logical parent project.
/// </summary>
string
DisplayName
{
get
;
}
/// <summary>
/// The name of the project according to the project system. In "regular" projects this is
/// equivalent to <see cref="DisplayName"/>, but in Venus cases these will differ. The
/// ProjectSystemName is the 2_Default.aspx project name, whereas the regular display name
/// matches the display name of the project the user actually sees in the solution explorer.
/// These can be assumed to be unique within the Visual Studio workspace.
/// </summary>
string
ProjectSystemName
{
get
;
}
IVisualStudioHostDocument
GetDocumentOrAdditionalDocument
(
DocumentId
id
);
...
...
src/VisualStudio/Core/Def/Implementation/ProjectSystem/MiscellaneousFilesWorkspace.HostProject.cs
浏览文件 @
d14741f0
...
...
@@ -77,7 +77,8 @@ public ProjectInfo CreateProjectInfoForCurrentState()
public
Workspace
Workspace
=>
_workspace
;
public
string
ProjectSystemName
=>
"MiscellaneousFiles"
;
public
string
DisplayName
=>
"MiscellaneousFiles"
;
public
string
ProjectSystemName
=>
DisplayName
;
public
IVisualStudioHostDocument
GetDocumentOrAdditionalDocument
(
DocumentId
id
)
{
...
...
src/VisualStudio/Core/Next/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs
浏览文件 @
d14741f0
...
...
@@ -245,7 +245,7 @@ public sealed override Task OnDefinitionFoundAsync(DefinitionItem definition)
protected
abstract
Task
OnDefinitionFoundWorkerAsync
(
DefinitionItem
definition
);
protected
async
Task
<(
Guid
,
SourceText
)>
GetGuid
AndSourceTextAsync
(
Document
document
)
protected
async
Task
<(
Guid
,
string
projectName
,
SourceText
)>
GetGuidAndProjectName
AndSourceTextAsync
(
Document
document
)
{
// The FAR system needs to know the guid for the project that a def/reference is
// from (to support features like filtering). Normally that would mean we could
...
...
@@ -254,10 +254,13 @@ protected async Task<(Guid, SourceText)> GetGuidAndSourceTextAsync(Document docu
// when we have another type of workspace. This means we will show results, but
// certain features (like filtering) may not work in that context.
var
workspace
=
document
.
Project
.
Solution
.
Workspace
as
VisualStudioWorkspaceImpl
;
var
guid
=
workspace
?.
GetHostProject
(
document
.
Project
.
Id
)?.
Guid
??
Guid
.
Empty
;
var
hostProject
=
workspace
?.
GetHostProject
(
document
.
Project
.
Id
);
var
projectName
=
hostProject
?.
DisplayName
??
document
.
Project
.
Name
;
var
guid
=
hostProject
?.
Guid
??
Guid
.
Empty
;
var
sourceText
=
await
document
.
GetTextAsync
(
CancellationToken
).
ConfigureAwait
(
false
);
return
(
guid
,
sourceText
);
return
(
guid
,
projectName
,
sourceText
);
}
protected
async
Task
<
Entry
>
CreateDocumentSpanEntryAsync
(
...
...
@@ -266,7 +269,7 @@ protected async Task<(Guid, SourceText)> GetGuidAndSourceTextAsync(Document docu
HighlightSpanKind
spanKind
)
{
var
document
=
documentSpan
.
Document
;
var
(
guid
,
sourceText
)
=
await
GetGuid
AndSourceTextAsync
(
document
).
ConfigureAwait
(
false
);
var
(
guid
,
projectName
,
sourceText
)
=
await
GetGuidAndProjectName
AndSourceTextAsync
(
document
).
ConfigureAwait
(
false
);
var
narrowSpan
=
documentSpan
.
SourceSpan
;
var
lineSpan
=
GetLineSpanForReference
(
sourceText
,
narrowSpan
);
...
...
@@ -275,7 +278,7 @@ protected async Task<(Guid, SourceText)> GetGuidAndSourceTextAsync(Document docu
return
new
DocumentSpanEntry
(
this
,
definitionBucket
,
documentSpan
,
spanKind
,
guid
,
sourceText
,
taggedLineParts
);
projectName
,
guid
,
sourceText
,
taggedLineParts
);
}
private
TextSpan
GetLineSpanForReference
(
SourceText
sourceText
,
TextSpan
referenceSpan
)
...
...
src/VisualStudio/Core/Next/FindReferences/Contexts/WithoutReferencesFindUsagesContext.cs
浏览文件 @
d14741f0
...
...
@@ -81,9 +81,9 @@ protected override async Task OnDefinitionFoundWorkerAsync(DefinitionItem defini
RoslynDefinitionBucket
definitionBucket
,
DefinitionItem
definition
)
{
var
documentSpan
=
definition
.
SourceSpans
[
0
];
var
(
guid
,
sourceText
)
=
await
GetGuid
AndSourceTextAsync
(
documentSpan
.
Document
).
ConfigureAwait
(
false
);
var
(
guid
,
projectName
,
sourceText
)
=
await
GetGuidAndProjectName
AndSourceTextAsync
(
documentSpan
.
Document
).
ConfigureAwait
(
false
);
return
new
DefinitionItemEntry
(
this
,
definitionBucket
,
documentSpan
,
guid
,
sourceText
);
return
new
DefinitionItemEntry
(
this
,
definitionBucket
,
documentSpan
,
projectName
,
guid
,
sourceText
);
}
}
}
...
...
src/VisualStudio/Core/Next/FindReferences/Entries/AbstractDocumentSpanEntry.cs
浏览文件 @
d14741f0
...
...
@@ -24,6 +24,7 @@ private abstract class AbstractDocumentSpanEntry : Entry
private
readonly
AbstractTableDataSourceFindUsagesContext
_context
;
private
readonly
DocumentSpan
_documentSpan
;
private
readonly
string
_projectName
;
private
readonly
object
_boxedProjectGuid
;
protected
readonly
SourceText
_sourceText
;
...
...
@@ -31,13 +32,14 @@ private abstract class AbstractDocumentSpanEntry : Entry
AbstractTableDataSourceFindUsagesContext
context
,
RoslynDefinitionBucket
definitionBucket
,
DocumentSpan
documentSpan
,
string
projectName
,
Guid
projectGuid
,
SourceText
sourceText
)
:
base
(
definitionBucket
)
{
_context
=
context
;
_documentSpan
=
documentSpan
;
_projectName
=
projectName
;
_boxedProjectGuid
=
projectGuid
;
_sourceText
=
sourceText
;
}
...
...
@@ -58,7 +60,7 @@ protected override object GetValueWorker(string keyName)
case
StandardTableKeyNames
.
Column
:
return
_sourceText
.
Lines
.
GetLinePosition
(
SourceSpan
.
Start
).
Character
;
case
StandardTableKeyNames
.
ProjectName
:
return
Document
.
Project
.
Name
;
return
_project
Name
;
case
StandardTableKeyNames
.
ProjectGuid
:
return
_boxedProjectGuid
;
case
StandardTableKeyNames
.
Text
:
...
...
src/VisualStudio/Core/Next/FindReferences/Entries/DefinitionItemEntry.cs
浏览文件 @
d14741f0
...
...
@@ -22,9 +22,10 @@ private class DefinitionItemEntry : AbstractDocumentSpanEntry
AbstractTableDataSourceFindUsagesContext
context
,
RoslynDefinitionBucket
definitionBucket
,
DocumentSpan
documentSpan
,
string
documentName
,
Guid
projectGuid
,
SourceText
sourceText
)
:
base
(
context
,
definitionBucket
,
documentSpan
,
projectGuid
,
sourceText
)
:
base
(
context
,
definitionBucket
,
documentSpan
,
documentName
,
projectGuid
,
sourceText
)
{
}
...
...
src/VisualStudio/Core/Next/FindReferences/Entries/DocumentSpanEntry.cs
浏览文件 @
d14741f0
...
...
@@ -39,10 +39,11 @@ private class DocumentSpanEntry : AbstractDocumentSpanEntry
RoslynDefinitionBucket
definitionBucket
,
DocumentSpan
documentSpan
,
HighlightSpanKind
spanKind
,
string
documentName
,
Guid
projectGuid
,
SourceText
sourceText
,
ClassifiedSpansAndHighlightSpan
classifiedSpans
)
:
base
(
context
,
definitionBucket
,
documentSpan
,
projectGuid
,
sourceText
)
:
base
(
context
,
definitionBucket
,
documentSpan
,
documentName
,
projectGuid
,
sourceText
)
{
_spanKind
=
spanKind
;
_classifiedSpansAndHighlights
=
classifiedSpans
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录