Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
cd8cf316
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,发现更多精彩内容 >>
提交
cd8cf316
编写于
5月 30, 2016
作者:
H
Heejae Chang
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11591 from heejaechang/telemetry2
fix issue with telemetry.
上级
4bc748b1
d09448d7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
22 deletion
+41
-22
src/Features/Core/Portable/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs
...gnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs
+6
-1
src/Features/Core/Portable/Diagnostics/EngineV2/CompilerAnalysisResult.cs
...e/Portable/Diagnostics/EngineV2/CompilerAnalysisResult.cs
+24
-0
src/Features/Core/Portable/Diagnostics/EngineV2/CompilerDiagnosticExecutor.cs
...rtable/Diagnostics/EngineV2/CompilerDiagnosticExecutor.cs
+2
-2
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs
...ostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs
+7
-18
src/Features/Core/Portable/Features.csproj
src/Features/Core/Portable/Features.csproj
+1
-0
src/Features/Core/Portable/SolutionCrawler/SolutionCrawlerLogger.cs
...es/Core/Portable/SolutionCrawler/SolutionCrawlerLogger.cs
+1
-1
未找到文件。
src/Features/Core/Portable/Diagnostics/DiagnosticAnalyzerService_IncrementalAnalyzer.cs
浏览文件 @
cd8cf316
...
...
@@ -16,7 +16,7 @@
namespace
Microsoft.CodeAnalysis.Diagnostics
{
[
ExportIncrementalAnalyzerProvider
(
highPriorityForActiveFile
:
true
,
name
:
WellKnownSolutionCrawlerAnalyzers
.
Diagnostic
,
highPriorityForActiveFile
:
true
,
name
:
WellKnownSolutionCrawlerAnalyzers
.
Diagnostic
,
workspaceKinds
:
new
string
[]
{
WorkspaceKind
.
Host
,
WorkspaceKind
.
Interactive
})]
internal
partial
class
DiagnosticAnalyzerService
:
IIncrementalAnalyzerProvider
{
...
...
@@ -188,6 +188,11 @@ public override Task SynchronizeWithBuildAsync(Workspace workspace, ImmutableDic
}
#
endregion
public
override
void
LogAnalyzerCountSummary
()
{
Analyzer
.
LogAnalyzerCountSummary
();
}
public
void
TurnOff
(
bool
useV2
)
{
var
turnedOffAnalyzer
=
GetAnalyzer
(!
useV2
);
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/CompilerAnalysisResult.cs
0 → 100644
浏览文件 @
cd8cf316
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using
System.Collections.Immutable
;
using
Microsoft.CodeAnalysis.Diagnostics.Telemetry
;
namespace
Microsoft.CodeAnalysis.Diagnostics.EngineV2
{
/// <summary>
/// Basically typed tuple.
/// </summary>
internal
struct
CompilerAnalysisResult
{
public
readonly
ImmutableDictionary
<
DiagnosticAnalyzer
,
AnalysisResult
>
AnalysisResult
;
public
readonly
ImmutableDictionary
<
DiagnosticAnalyzer
,
AnalyzerTelemetryInfo
>
TelemetryInfo
;
public
CompilerAnalysisResult
(
ImmutableDictionary
<
DiagnosticAnalyzer
,
AnalysisResult
>
analysisResult
,
ImmutableDictionary
<
DiagnosticAnalyzer
,
AnalyzerTelemetryInfo
>
telemetryInfo
)
{
AnalysisResult
=
analysisResult
;
TelemetryInfo
=
telemetryInfo
;
}
}
}
src/Features/Core/Portable/Diagnostics/EngineV2/CompilerDiagnosticExecutor.cs
浏览文件 @
cd8cf316
...
...
@@ -14,7 +14,7 @@ namespace Microsoft.CodeAnalysis.Diagnostics.EngineV2
/// </summary>
internal
static
class
CompilerDiagnosticExecutor
{
public
static
async
Task
<
ImmutableDictionary
<
DiagnosticAnalyzer
,
AnalysisResult
>
>
AnalyzeAsync
(
this
CompilationWithAnalyzers
analyzerDriver
,
Project
project
,
CancellationToken
cancellationToken
)
public
static
async
Task
<
CompilerAnalysisResult
>
AnalyzeAsync
(
this
CompilationWithAnalyzers
analyzerDriver
,
Project
project
,
CancellationToken
cancellationToken
)
{
var
version
=
await
DiagnosticIncrementalAnalyzer
.
GetDiagnosticVersionAsync
(
project
,
cancellationToken
).
ConfigureAwait
(
false
);
...
...
@@ -61,7 +61,7 @@ internal static class CompilerDiagnosticExecutor
builder
.
Add
(
analyzer
,
result
.
ToResult
());
}
return
builder
.
ToImmutable
(
);
return
new
CompilerAnalysisResult
(
builder
.
ToImmutable
(),
analysisResult
.
AnalyzerTelemetryInfo
);
}
/// <summary>
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs
浏览文件 @
cd8cf316
...
...
@@ -7,6 +7,7 @@
using
System.Threading
;
using
System.Threading.Tasks
;
using
Microsoft.CodeAnalysis.Diagnostics.Log
;
using
Microsoft.CodeAnalysis.Diagnostics.Telemetry
;
using
Microsoft.CodeAnalysis.ErrorReporting
;
using
Microsoft.CodeAnalysis.Internal.Log
;
using
Microsoft.CodeAnalysis.Shared.Options
;
...
...
@@ -152,10 +153,11 @@ public IEnumerable<DiagnosticData> ConvertToLocalDiagnostics(Document targetDocu
if
(
analyzerDriverOpt
!=
null
)
{
// calculate regular diagnostic analyzers diagnostics
result
=
await
analyzerDriverOpt
.
AnalyzeAsync
(
project
,
cancellationToken
).
ConfigureAwait
(
false
);
var
compilerResult
=
await
analyzerDriverOpt
.
AnalyzeAsync
(
project
,
cancellationToken
).
ConfigureAwait
(
false
);
result
=
compilerResult
.
AnalysisResult
;
// record telemetry data
await
UpdateAnalyzerTelemetryDataAsync
(
analyzerDriverOpt
,
project
,
cancellationToken
).
ConfigureAwait
(
false
);
UpdateAnalyzerTelemetryData
(
compilerResult
,
project
,
cancellationToken
);
}
// check whether there is IDE specific project diagnostic analyzer
...
...
@@ -389,24 +391,11 @@ public IEnumerable<DiagnosticData> ConvertToLocalDiagnostics(Document targetDocu
}
}
private
async
Task
UpdateAnalyzerTelemetryDataAsync
(
CompilationWithAnalyzers
analyzerDriver
,
Project
project
,
CancellationToken
cancellationToken
)
private
void
UpdateAnalyzerTelemetryData
(
CompilerAnalysisResult
analysisResult
,
Project
project
,
CancellationToken
cancellationToken
)
{
foreach
(
var
analyzer
in
analyzerDriver
.
Analyzers
)
foreach
(
var
kv
in
analysisResult
.
TelemetryInfo
)
{
await
UpdateAnalyzerTelemetryDataAsync
(
analyzerDriver
,
analyzer
,
project
,
cancellationToken
).
ConfigureAwait
(
false
);
}
}
private
async
Task
UpdateAnalyzerTelemetryDataAsync
(
CompilationWithAnalyzers
analyzerDriver
,
DiagnosticAnalyzer
analyzer
,
Project
project
,
CancellationToken
cancellationToken
)
{
try
{
var
analyzerTelemetryInfo
=
await
analyzerDriver
.
GetAnalyzerTelemetryInfoAsync
(
analyzer
,
cancellationToken
).
ConfigureAwait
(
false
);
DiagnosticAnalyzerLogger
.
UpdateAnalyzerTypeCount
(
analyzer
,
analyzerTelemetryInfo
,
project
,
_owner
.
DiagnosticLogAggregator
);
}
catch
(
Exception
e
)
when
(
FatalError
.
ReportUnlessCanceled
(
e
))
{
throw
ExceptionUtilities
.
Unreachable
;
DiagnosticAnalyzerLogger
.
UpdateAnalyzerTypeCount
(
kv
.
Key
,
kv
.
Value
,
project
,
_owner
.
DiagnosticLogAggregator
);
}
}
...
...
src/Features/Core/Portable/Features.csproj
浏览文件 @
cd8cf316
...
...
@@ -210,6 +210,7 @@
<Compile
Include=
"Diagnostics\EngineV1\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs"
/>
<Compile
Include=
"Diagnostics\EngineV1\DiagnosticIncrementalAnalyzer_GetLatestDiagnosticsForSpan.cs"
/>
<Compile
Include=
"Diagnostics\EngineV1\MemberRangeMap.cs"
/>
<Compile
Include=
"Diagnostics\EngineV2\CompilerAnalysisResult.cs"
/>
<Compile
Include=
"Diagnostics\EngineV2\DiagnosticDataSerializer.cs"
/>
<Compile
Include=
"Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.AnalysisData.cs"
/>
<Compile
Include=
"Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.AnalysisKind.cs"
/>
...
...
src/Features/Core/Portable/SolutionCrawler/SolutionCrawlerLogger.cs
浏览文件 @
cd8cf316
...
...
@@ -249,7 +249,7 @@ public static void LogIncrementalAnalyzerProcessorStatistics(int correlationId,
foreach
(
var
analyzer
in
analyzers
)
{
var
diagIncrementalAnalyzer
=
analyzer
as
BaseDiagnosticIncrementalAnalyzer
;
var
diagIncrementalAnalyzer
=
analyzer
as
DiagnosticAnalyzerService
.
IncrementalAnalyzerDelegatee
;
if
(
diagIncrementalAnalyzer
!=
null
)
{
diagIncrementalAnalyzer
.
LogAnalyzerCountSummary
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录