Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
67f0ea17
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,发现更多精彩内容 >>
未验证
提交
67f0ea17
编写于
12月 05, 2018
作者:
H
Heejae Chang
提交者:
GitHub
12月 05, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make sure VS to not crash when analyzer.initialize throws (#31543)
上级
779880d5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
12 deletion
+29
-12
src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs
src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs
+21
-11
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.StateSet.cs
...ostics/EngineV2/DiagnosticIncrementalAnalyzer.StateSet.cs
+8
-1
未找到文件。
src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs
浏览文件 @
67f0ea17
...
@@ -292,7 +292,7 @@ private static IEnumerable<AnalyzerPerformanceInfo> Convert(IEnumerable<(Diagnos
...
@@ -292,7 +292,7 @@ private static IEnumerable<AnalyzerPerformanceInfo> Convert(IEnumerable<(Diagnos
return
analyzerPerf
.
Select
(
kv
=>
new
AnalyzerPerformanceInfo
(
kv
.
analyzer
.
GetAnalyzerId
(),
DiagnosticAnalyzerLogger
.
AllowsTelemetry
(
kv
.
analyzer
,
serviceOpt
),
kv
.
timeSpan
));
return
analyzerPerf
.
Select
(
kv
=>
new
AnalyzerPerformanceInfo
(
kv
.
analyzer
.
GetAnalyzerId
(),
DiagnosticAnalyzerLogger
.
AllowsTelemetry
(
kv
.
analyzer
,
serviceOpt
),
kv
.
timeSpan
));
}
}
public
static
bool
IsCompilationEndAnalyzer
(
this
DiagnosticAnalyzer
analyzer
,
Project
project
,
Compilation
compilation
)
public
static
bool
?
IsCompilationEndAnalyzer
(
this
DiagnosticAnalyzer
analyzer
,
Project
project
,
Compilation
compilation
)
{
{
if
(!
project
.
SupportsCompilation
)
if
(!
project
.
SupportsCompilation
)
{
{
...
@@ -301,16 +301,26 @@ public static bool IsCompilationEndAnalyzer(this DiagnosticAnalyzer analyzer, Pr
...
@@ -301,16 +301,26 @@ public static bool IsCompilationEndAnalyzer(this DiagnosticAnalyzer analyzer, Pr
Contract
.
ThrowIfNull
(
compilation
);
Contract
.
ThrowIfNull
(
compilation
);
// currently, this is only way to see whether analyzer has compilation end analysis or not.
try
// also, analyzer being compilation end analyzer or not is dynamic. so this can return different value based on
{
// given compilation or options.
// currently, this is only way to see whether analyzer has compilation end analysis or not.
//
// also, analyzer being compilation end analyzer or not is dynamic. so this can return different value based on
// but for now, this is what we decided in design meeting until we decide how to deal with compilation end analyzer
// given compilation or options.
// long term
//
var
context
=
new
CollectCompilationActionsContext
(
compilation
,
project
.
AnalyzerOptions
);
// but for now, this is what we decided in design meeting until we decide how to deal with compilation end analyzer
analyzer
.
Initialize
(
context
);
// long term
var
context
=
new
CollectCompilationActionsContext
(
compilation
,
project
.
AnalyzerOptions
);
return
context
.
IsCompilationEndAnalyzer
;
analyzer
.
Initialize
(
context
);
return
context
.
IsCompilationEndAnalyzer
;
}
catch
{
// analyzer.initialize can throw. when that happens, we will try again next time.
// we are not logging anything here since it will be logged by CompilationWithAnalyzer later
// in the error list
return
null
;
}
}
}
/// <summary>
/// <summary>
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.StateSet.cs
浏览文件 @
67f0ea17
...
@@ -265,7 +265,14 @@ public void ComputeCompilationEndAnalyzer(Project project, Compilation compilati
...
@@ -265,7 +265,14 @@ public void ComputeCompilationEndAnalyzer(Project project, Compilation compilati
}
}
// running this multiple time is fine
// running this multiple time is fine
_compilationEndAnalyzer
=
_analyzer
.
IsCompilationEndAnalyzer
(
project
,
compilation
)
?
1
:
0
;
var
result
=
_analyzer
.
IsCompilationEndAnalyzer
(
project
,
compilation
);
if
(!
result
.
HasValue
)
{
// try again next time.
return
;
}
_compilationEndAnalyzer
=
result
.
Value
?
1
:
0
;
}
}
public
bool
IsCompilationEndAnalyzer
(
Project
project
,
Compilation
compilation
)
public
bool
IsCompilationEndAnalyzer
(
Project
project
,
Compilation
compilation
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录