Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
3763b449
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,发现更多精彩内容 >>
提交
3763b449
编写于
4月 22, 2016
作者:
H
Heejae Chang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make sure we ignore full solution analysis option on GetDiagnostics
上级
e5b312ad
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
7 deletion
+15
-7
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs
...ostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs
+8
-3
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnostics.cs
.../EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnostics.cs
+5
-3
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs
...neV2/DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs
+2
-1
未找到文件。
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs
浏览文件 @
3763b449
...
...
@@ -90,7 +90,7 @@ public IEnumerable<DiagnosticData> ConvertToLocalDiagnostics(Document targetDocu
/// Return all diagnostics that belong to given project for the given StateSets (analyzers) either from cache or by calculating them
/// </summary>
public
async
Task
<
ProjectAnalysisData
>
GetProjectAnalysisDataAsync
(
CompilationWithAnalyzers
analyzerDriverOpt
,
Project
project
,
IEnumerable
<
StateSet
>
stateSets
,
CancellationToken
cancellationToken
)
CompilationWithAnalyzers
analyzerDriverOpt
,
Project
project
,
IEnumerable
<
StateSet
>
stateSets
,
bool
ignoreOption
,
CancellationToken
cancellationToken
)
{
using
(
Logger
.
LogBlock
(
FunctionId
.
Diagnostics_ProjectDiagnostic
,
GetProjectLogMessage
,
project
,
stateSets
,
cancellationToken
))
{
...
...
@@ -107,7 +107,7 @@ public IEnumerable<DiagnosticData> ConvertToLocalDiagnostics(Document targetDocu
}
// perf optimization. check whether we want to analyze this project or not.
if
(!
await
FullAnalysisEnabledAsync
(
project
,
cancellationToken
).
ConfigureAwait
(
false
))
if
(!
await
FullAnalysisEnabledAsync
(
project
,
ignoreOption
,
cancellationToken
).
ConfigureAwait
(
false
))
{
return
new
ProjectAnalysisData
(
project
.
Id
,
version
,
existingData
.
Result
,
ImmutableDictionary
<
DiagnosticAnalyzer
,
AnalysisResult
>.
Empty
);
}
...
...
@@ -402,11 +402,16 @@ private async Task UpdateAnalyzerTelemetryDataAsync(CompilationWithAnalyzers ana
}
}
private
static
async
Task
<
bool
>
FullAnalysisEnabledAsync
(
Project
project
,
CancellationToken
cancellationToken
)
private
static
async
Task
<
bool
>
FullAnalysisEnabledAsync
(
Project
project
,
bool
ignoreOption
,
CancellationToken
cancellationToken
)
{
var
workspace
=
project
.
Solution
.
Workspace
;
var
language
=
project
.
Language
;
if
(
ignoreOption
)
{
return
await
project
.
HasSuccessfullyLoadedAsync
(
cancellationToken
).
ConfigureAwait
(
false
);
}
if
(!
workspace
.
Options
.
GetOption
(
ServiceFeatureOnOffOptions
.
ClosedFileDiagnostic
,
language
)
||
!
workspace
.
Options
.
GetOption
(
RuntimeOptions
.
FullSolutionAnalysis
))
{
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnostics.cs
浏览文件 @
3763b449
...
...
@@ -399,7 +399,8 @@ protected override async Task AppendDiagnosticsAsync(Project project, IEnumerabl
// unlike the suppressed (disabled) analyzer, we will include hidden diagnostic only analyzers here.
var
analyzerDriverOpt
=
await
Owner
.
_compilationManager
.
CreateAnalyzerDriverAsync
(
project
,
stateSets
,
IncludeSuppressedDiagnostics
,
cancellationToken
).
ConfigureAwait
(
false
);
var
result
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
cancellationToken
).
ConfigureAwait
(
false
);
var
ignoreOption
=
true
;
var
result
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
ignoreOption
,
cancellationToken
).
ConfigureAwait
(
false
);
foreach
(
var
stateSet
in
stateSets
)
{
...
...
@@ -445,6 +446,7 @@ private bool ShouldIncludeStateSet(Project project, StateSet stateSet)
// Here, we don't care what kind of analyzer (StateSet) is given.
// We just create and use AnalyzerDriver with the given analyzer (StateSet).
var
ignoreOption
=
true
;
var
analyzerDriverOpt
=
await
Owner
.
_compilationManager
.
CreateAnalyzerDriverAsync
(
project
,
stateSets
,
IncludeSuppressedDiagnostics
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
documentId
!=
null
)
...
...
@@ -462,7 +464,7 @@ private bool ShouldIncludeStateSet(Project project, StateSet stateSet)
}
case
AnalysisKind
.
NonLocal
:
{
var
nonLocalDocumentResult
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
cancellationToken
).
ConfigureAwait
(
false
);
var
nonLocalDocumentResult
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
ignoreOption
,
cancellationToken
).
ConfigureAwait
(
false
);
var
analysisResult
=
nonLocalDocumentResult
.
GetResult
(
stateSet
.
Analyzer
);
return
GetResult
(
analysisResult
,
AnalysisKind
.
NonLocal
,
documentId
);
}
...
...
@@ -472,7 +474,7 @@ private bool ShouldIncludeStateSet(Project project, StateSet stateSet)
}
Contract
.
ThrowIfFalse
(
kind
==
AnalysisKind
.
NonLocal
);
var
projectResult
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
cancellationToken
).
ConfigureAwait
(
false
);
var
projectResult
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
ignoreOption
,
cancellationToken
).
ConfigureAwait
(
false
);
return
projectResult
.
GetResult
(
stateSet
.
Analyzer
).
Others
;
}
}
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs
浏览文件 @
3763b449
...
...
@@ -83,7 +83,8 @@ public override async Task AnalyzeProjectAsync(Project project, bool semanticsCh
var
includeSuppressedDiagnostics
=
true
;
var
analyzerDriverOpt
=
await
_compilationManager
.
CreateAnalyzerDriverAsync
(
project
,
activeAnalyzers
,
includeSuppressedDiagnostics
,
cancellationToken
).
ConfigureAwait
(
false
);
var
result
=
await
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
cancellationToken
).
ConfigureAwait
(
false
);
var
ignoreOption
=
false
;
var
result
=
await
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
ignoreOption
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
result
.
FromCache
)
{
RaiseProjectDiagnosticsIfNeeded
(
project
,
stateSets
,
result
.
Result
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录