Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
462f50c5
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,发现更多精彩内容 >>
提交
462f50c5
编写于
1月 27, 2016
作者:
H
Heejae Chang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed where project name gets disappeared if a project is unloaded in "BuildOnly" error list mode.
now we will show <Unknown> for such project.
上级
522e1e0d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
80 addition
and
27 deletion
+80
-27
src/VisualStudio/Core/Def/Implementation/TableDataSource/AbstractTableDataSource.cs
...Implementation/TableDataSource/AbstractTableDataSource.cs
+28
-23
src/VisualStudio/Core/Def/Implementation/TableDataSource/TableItem.cs
...udio/Core/Def/Implementation/TableDataSource/TableItem.cs
+3
-3
src/VisualStudio/Core/Def/Implementation/TableDataSource/VisualStudioDiagnosticListTable.BuildTableDataSource.cs
...e/VisualStudioDiagnosticListTable.BuildTableDataSource.cs
+31
-1
src/VisualStudio/Core/Def/Implementation/TableDataSource/VisualStudioDiagnosticListTable.cs
...tation/TableDataSource/VisualStudioDiagnosticListTable.cs
+6
-0
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
+9
-0
src/VisualStudio/Core/Def/ServicesVSResources.resx
src/VisualStudio/Core/Def/ServicesVSResources.resx
+3
-0
未找到文件。
src/VisualStudio/Core/Def/Implementation/TableDataSource/AbstractTableDataSource.cs
浏览文件 @
462f50c5
...
...
@@ -47,6 +47,29 @@ public AbstractTableDataSource(Workspace workspace)
public
abstract
string
Identifier
{
get
;
}
public
void
RefreshAllFactories
()
{
ImmutableArray
<
SubscriptionWithoutLock
>
snapshot
;
List
<
TableEntriesFactory
<
TData
>>
factories
;
lock
(
_gate
)
{
snapshot
=
_subscriptions
;
factories
=
_map
.
Values
.
ToList
();
}
// let table manager know that we want to refresh factories.
for
(
var
i
=
0
;
i
<
snapshot
.
Length
;
i
++)
{
foreach
(
var
factory
in
factories
)
{
factory
.
OnRefreshed
();
snapshot
[
i
].
AddOrUpdate
(
factory
,
newFactory
:
false
);
}
}
}
public
void
Refresh
(
TableEntriesFactory
<
TData
>
factory
)
{
var
snapshot
=
_subscriptions
;
...
...
@@ -59,6 +82,11 @@ public void Refresh(TableEntriesFactory<TData> factory)
public
void
Shutdown
()
{
// editor team wants us to update snapshot versions before
// removing factories on shutdown.
RefreshAllFactories
();
// and then remove all factories.
ImmutableArray
<
SubscriptionWithoutLock
>
snapshot
;
lock
(
_gate
)
...
...
@@ -214,29 +242,6 @@ protected void ChangeStableState(bool stable)
}
}
protected
void
RefreshAllFactories
()
{
ImmutableArray
<
SubscriptionWithoutLock
>
snapshot
;
List
<
TableEntriesFactory
<
TData
>>
factories
;
lock
(
_gate
)
{
snapshot
=
_subscriptions
;
factories
=
_map
.
Values
.
ToList
();
}
// let table manager know that we want to refresh factories.
for
(
var
i
=
0
;
i
<
snapshot
.
Length
;
i
++)
{
foreach
(
var
factory
in
factories
)
{
factory
.
OnRefreshed
();
snapshot
[
i
].
AddOrUpdate
(
factory
,
newFactory
:
false
);
}
}
}
protected
void
AddAggregateKey
(
object
data
,
object
aggregateKey
)
{
_aggregateKeyMap
.
Add
(
GetItemKey
(
data
),
aggregateKey
);
...
...
src/VisualStudio/Core/Def/Implementation/TableDataSource/TableItem.cs
浏览文件 @
462f50c5
...
...
@@ -94,17 +94,17 @@ public string ProjectName
var
projectId
=
Extensions
.
GetProjectId
(
Primary
);
if
(
projectId
==
null
)
{
return
null
;
return
ServicesVSResources
.
Unknown
;
}
if
(
_cache
==
null
)
{
// return single project name
return
Workspace
.
GetProjectName
(
projectId
);
return
Workspace
.
GetProjectName
(
projectId
)
??
ServicesVSResources
.
Unknown
;
}
// return joined project names
return
_cache
.
GetProjectName
(
Workspace
);
return
_cache
.
GetProjectName
(
Workspace
)
??
ServicesVSResources
.
Unknown
;
}
}
...
...
src/VisualStudio/Core/Def/Implementation/TableDataSource/VisualStudioDiagnosticListTable.BuildTableDataSource.cs
浏览文件 @
462f50c5
...
...
@@ -257,10 +257,40 @@ public override bool TryNavigateTo(int index, bool previewTab)
return
false
;
}
return
TryNavigateTo
(
item
.
Workspace
,
item
.
DocumentId
,
return
TryNavigateTo
(
item
.
Workspace
,
GetProperDocumentId
(
item
)
,
item
.
DataLocation
?.
OriginalStartLine
??
0
,
item
.
DataLocation
?.
OriginalStartColumn
??
0
,
previewTab
);
}
private
DocumentId
GetProperDocumentId
(
DiagnosticData
data
)
{
// check whether documentId still exist. it might have changed if project it belong to has reloaded.
var
solution
=
data
.
Workspace
.
CurrentSolution
;
if
(
solution
.
GetDocument
(
data
.
DocumentId
)
!=
null
)
{
return
data
.
DocumentId
;
}
// okay, documentId no longer exist in current solution, find it by file path.
if
(
string
.
IsNullOrWhiteSpace
(
data
.
DataLocation
?.
OriginalFilePath
))
{
// we don't have filepath
return
null
;
}
var
documentIds
=
solution
.
GetDocumentIdsWithFilePath
(
data
.
DataLocation
.
OriginalFilePath
);
foreach
(
var
id
in
documentIds
)
{
// found right documentId;
if
(
id
.
ProjectId
==
data
.
ProjectId
)
{
return
id
;
}
}
// okay, there is no right one, take the first one if there is any
return
documentIds
.
FirstOrDefault
();
}
protected
override
bool
IsEquivalent
(
DiagnosticData
item1
,
DiagnosticData
item2
)
{
// everything same except location
...
...
src/VisualStudio/Core/Def/Implementation/TableDataSource/VisualStudioDiagnosticListTable.cs
浏览文件 @
462f50c5
...
...
@@ -78,6 +78,9 @@ protected override void AddTableSourceIfNecessary(Solution solution)
{
if
(
solution
.
ProjectIds
.
Count
==
0
)
{
// whenever there is a change in solution, make sure we refresh static info
// of build errors so that things like project name correctly refreshed
_buildTableSource
.
RefreshAllFactories
();
return
;
}
...
...
@@ -89,6 +92,9 @@ protected override void RemoveTableSourceIfNecessary(Solution solution)
{
if
(
solution
.
ProjectIds
.
Count
>
0
)
{
// whenever there is a change in solution, make sure we refresh static info
// of build errors so that things like project name correctly refreshed
_buildTableSource
.
RefreshAllFactories
();
return
;
}
...
...
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
浏览文件 @
462f50c5
...
...
@@ -1146,6 +1146,15 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to <Unknown>.
/// </summary>
internal
static
string
Unknown
{
get
{
return
ResourceManager
.
GetString
(
"Unknown"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Unknown rename type.
/// </summary>
...
...
src/VisualStudio/Core/Def/ServicesVSResources.resx
浏览文件 @
462f50c5
...
...
@@ -516,4 +516,7 @@ Use the dropdown to view and switch to other projects this file may belong to.</
<data
name=
"FullSolutionAnalysisOff"
xml:space=
"preserve"
>
<value>
Low memory detected. Full solution analysis disabled for this solution.
</value>
</data>
<data
name=
"Unknown"
xml:space=
"preserve"
>
<value>
<
Unknown
>
</value>
</data>
</root>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录