Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
6f68907c
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,发现更多精彩内容 >>
提交
6f68907c
编写于
5月 25, 2017
作者:
H
Heejae Chang
浏览文件
操作
浏览文件
下载
差异文件
fixed merge conflict
上级
0020c3b8
fc8433ab
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
80 addition
and
28 deletion
+80
-28
build/Targets/Imports.targets
build/Targets/Imports.targets
+1
-1
build/Targets/Packages.props
build/Targets/Packages.props
+1
-1
build/scripts/build-utils.ps1
build/scripts/build-utils.ps1
+1
-1
build/scripts/cibuild.ps1
build/scripts/cibuild.ps1
+4
-0
src/EditorFeatures/TestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
...ies/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
+1
-1
src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs
src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs
+19
-0
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticAnalyzerExecutor.cs
...rtable/Diagnostics/EngineV2/DiagnosticAnalyzerExecutor.cs
+25
-4
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs
...ostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs
+12
-8
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnostics.cs
.../EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnostics.cs
+5
-5
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs
...neV2/DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs
+2
-2
src/VisualStudio/Core/Test.Next/Services/VisualStudioDiagnosticAnalyzerExecutorTests.cs
...t/Services/VisualStudioDiagnosticAnalyzerExecutorTests.cs
+8
-2
src/Workspaces/Core/Portable/Workspaces.csproj
src/Workspaces/Core/Portable/Workspaces.csproj
+1
-3
未找到文件。
build/Targets/Imports.targets
浏览文件 @
6f68907c
...
...
@@ -445,7 +445,7 @@
<Error
Text=
"IBCMerge not found at $(IbcMergePath). Local developer builds should pass /p:SkipApplyOptimizations=true to avoid this"
Condition=
"!Exists('$(IbcMergePath)')"
/>
<Exec
Command=
""$(IbcMergePath)" -q -f -partialNGEN -minify -mo "@(IntermediateAssembly)" -incremental "$(OptimizationDataFile)""
<Exec
Command=
""$(IbcMergePath)" -q -f -partialNGEN -minify -mo "@(IntermediateAssembly)" -incremental
-excludeGenmethUnboxingStubs
"$(OptimizationDataFile)""
ConsoleToMSBuild=
"true"
Condition=
"Exists('$(IbcMergePath)')"
>
<Output
TaskParameter=
"ConsoleOutput"
PropertyName=
"IbcMergeOutput"
/>
...
...
build/Targets/Packages.props
浏览文件 @
6f68907c
...
...
@@ -39,7 +39,7 @@
<MicrosoftDiaSymReaderConverterXmlVersion>
1.0.0-beta1-61708-01
</MicrosoftDiaSymReaderConverterXmlVersion>
<MicrosoftDiaSymReaderNativeVersion>
1.6.0-beta2-25304
</MicrosoftDiaSymReaderNativeVersion>
<MicrosoftDiaSymReaderPortablePdbVersion>
1.3.0-beta1-61619-01
</MicrosoftDiaSymReaderPortablePdbVersion>
<MicrosoftDotNetIBCMerge>
4.7.
1
-alpha-00001
</MicrosoftDotNetIBCMerge>
<MicrosoftDotNetIBCMerge>
4.7.
2
-alpha-00001
</MicrosoftDotNetIBCMerge>
<MicrosoftIdentityModelClientsActiveDirectoryVersion>
3.13.8
</MicrosoftIdentityModelClientsActiveDirectoryVersion>
<MicrosoftInternalPerformanceCodeMarkersDesignTimeVersion>
15.0.26507-alpha
</MicrosoftInternalPerformanceCodeMarkersDesignTimeVersion>
<MicrosoftInternalVisualStudioShellInterop140DesignTimeVersion>
14.3.25407-alpha
</MicrosoftInternalVisualStudioShellInterop140DesignTimeVersion>
...
...
build/scripts/build-utils.ps1
浏览文件 @
6f68907c
...
...
@@ -265,7 +265,7 @@ function Restore-Project([string]$fileName, [string]$nuget, [string]$msbuildDir)
$filePath
=
Join-Path
$repoDir
$fileName
}
Exec-Block
{
&
$nuget
restore
-verbosity
quiet
-configfile
$nugetConfig
-MSBuildPath
$msbuildDir
-Project2ProjectTimeOut
1200
$filePath
}
Exec-Block
{
&
$nuget
restore
-verbosity
quiet
-configfile
$nugetConfig
-MSBuildPath
$msbuildDir
-Project2ProjectTimeOut
1200
$filePath
}
|
Write-Host
}
# Restore all of the projects that the repo consumes
...
...
build/scripts/cibuild.ps1
浏览文件 @
6f68907c
...
...
@@ -110,7 +110,11 @@ try {
if
(
-not
$skipRestore
)
{
Write-Host
"Running restore"
# Temporary work around to help NuGet team debug a restore issue
${env:NUGET_SHOW_STACK}
=
"true"
Restore-All
-msbuildDir
$msbuildDir
Remove-Item
env:\NUGET_SHOW_STACK
}
# Ensure the binaries directory exists because msbuild can fail when part of the path to LogFile isn't present.
...
...
src/EditorFeatures/TestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
浏览文件 @
6f68907c
...
...
@@ -61,7 +61,7 @@ public TestParameters WithFixProviderData(object fixProviderData)
string
initialMarkup
,
TestParameters
parameters
)
{
var
workspace
=
TestWorkspace
.
IsWorkspaceElement
(
initialMarkup
)
?
TestWorkspace
.
Create
(
initialMarkup
)
?
TestWorkspace
.
Create
(
initialMarkup
,
openDocuments
:
false
)
:
CreateWorkspaceFromFile
(
initialMarkup
,
parameters
);
workspace
.
ApplyOptions
(
parameters
.
options
);
...
...
src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs
浏览文件 @
6f68907c
...
...
@@ -59,6 +59,25 @@ public static bool IsOpenFileOnly(this DiagnosticAnalyzer analyzer, Workspace wo
return
false
;
}
public
static
bool
ContainsOpenFileOnlyAnalyzers
(
this
CompilationWithAnalyzers
analyzerDriverOpt
,
Workspace
workspace
)
{
if
(
analyzerDriverOpt
==
null
)
{
// not Roslyn. no open file only analyzers
return
false
;
}
foreach
(
var
analyzer
in
analyzerDriverOpt
.
Analyzers
)
{
if
(
analyzer
.
IsOpenFileOnly
(
workspace
))
{
return
true
;
}
}
return
false
;
}
public
static
bool
HasNonHiddenDescriptor
(
this
DiagnosticAnalyzerService
service
,
DiagnosticAnalyzer
analyzer
,
Project
project
)
{
// most of analyzers, number of descriptor is quite small, so this should be cheap.
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticAnalyzerExecutor.cs
浏览文件 @
6f68907c
...
...
@@ -72,18 +72,27 @@ public AnalyzerExecutor(AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateS
return
await
AnalyzeInProcAsync
(
analyzerDriver
,
project
,
cancellationToken
).
ConfigureAwait
(
false
);
}
var
outOfProcResult
=
await
AnalyzeOutOfProcAsync
(
remoteHostClient
,
analyzerDriver
,
project
,
cancellationToken
).
ConfigureAwait
(
false
);
// due to OpenFileOnly analyzer, we need to run inproc as well for such analyzers
var
inProcResultTask
=
AnalyzeInProcAsync
(
CreateAnalyzerDriver
(
analyzerDriver
,
a
=>
a
.
IsOpenFileOnly
(
project
.
Solution
.
Workspace
)),
project
,
cancellationToken
);
var
outOfProcResultTask
=
AnalyzeOutOfProcAsync
(
remoteHostClient
,
analyzerDriver
,
project
,
cancellationToken
);
// run them concurrently in vs and remote host
await
Task
.
WhenAll
(
inProcResultTask
,
outOfProcResultTask
).
ConfigureAwait
(
false
);
// make sure things are not cancelled
cancellationToken
.
ThrowIfCancellationRequested
();
return
DiagnosticAnalysisResultMap
.
Create
(
outOfProcResult
.
AnalysisResult
,
outOfProcResult
.
TelemetryInfo
);
// merge 2 results
return
DiagnosticAnalysisResultMap
.
Create
(
inProcResultTask
.
Result
.
AnalysisResult
.
AddRange
(
outOfProcResultTask
.
Result
.
AnalysisResult
),
inProcResultTask
.
Result
.
TelemetryInfo
.
AddRange
(
outOfProcResultTask
.
Result
.
TelemetryInfo
));
}
private
async
Task
<
DiagnosticAnalysisResultMap
<
DiagnosticAnalyzer
,
DiagnosticAnalysisResult
>>
AnalyzeInProcAsync
(
CompilationWithAnalyzers
analyzerDriver
,
Project
project
,
CancellationToken
cancellationToken
)
{
if
(
analyzerDriver
.
Analyzers
.
Length
==
0
)
if
(
analyzerDriver
==
null
||
analyzerDriver
.
Analyzers
.
Length
==
0
)
{
// quick bail out
return
DiagnosticAnalysisResultMap
.
Create
(
ImmutableDictionary
<
DiagnosticAnalyzer
,
DiagnosticAnalysisResult
>.
Empty
,
ImmutableDictionary
<
DiagnosticAnalyzer
,
AnalyzerTelemetryInfo
>.
Empty
);
...
...
@@ -107,7 +116,7 @@ public AnalyzerExecutor(AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateS
var
snapshotService
=
solution
.
Workspace
.
Services
.
GetService
<
ISolutionSynchronizationService
>();
// TODO: this should be moved out
var
analyzerMap
=
CreateAnalyzerMap
(
analyzerDriver
.
Analyzers
);
var
analyzerMap
=
CreateAnalyzerMap
(
analyzerDriver
.
Analyzers
.
Where
(
a
=>
!
a
.
IsOpenFileOnly
(
project
.
Solution
.
Workspace
))
);
if
(
analyzerMap
.
Count
==
0
)
{
return
DiagnosticAnalysisResultMap
.
Create
(
ImmutableDictionary
<
DiagnosticAnalyzer
,
DiagnosticAnalysisResult
>.
Empty
,
ImmutableDictionary
<
DiagnosticAnalyzer
,
AnalyzerTelemetryInfo
>.
Empty
);
...
...
@@ -141,6 +150,18 @@ public AnalyzerExecutor(AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateS
}
}
private
CompilationWithAnalyzers
CreateAnalyzerDriver
(
CompilationWithAnalyzers
analyzerDriver
,
Func
<
DiagnosticAnalyzer
,
bool
>
predicate
)
{
var
analyzers
=
analyzerDriver
.
Analyzers
.
Where
(
predicate
).
ToImmutableArray
();
if
(
analyzers
.
Length
==
0
)
{
// return null since we can't create CompilationWithAnalyzers with 0 analyzers
return
null
;
}
return
analyzerDriver
.
Compilation
.
WithAnalyzers
(
analyzers
,
analyzerDriver
.
AnalysisOptions
);
}
private
CustomAsset
GetOptionsAsset
(
Solution
solution
,
string
language
,
CancellationToken
cancellationToken
)
{
// TODO: we need better way to deal with options. optionSet itself is green node but
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer.Executor.cs
浏览文件 @
6f68907c
...
...
@@ -91,7 +91,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
,
bool
ignoreFullAnalysisOptions
,
CancellationToken
cancellationToken
)
CompilationWithAnalyzers
analyzerDriverOpt
,
Project
project
,
IEnumerable
<
StateSet
>
stateSets
,
bool
forceAnalyzerRun
,
CancellationToken
cancellationToken
)
{
using
(
Logger
.
LogBlock
(
FunctionId
.
Diagnostics_ProjectDiagnostic
,
GetProjectLogMessage
,
project
,
stateSets
,
cancellationToken
))
{
...
...
@@ -102,13 +102,15 @@ public IEnumerable<DiagnosticData> ConvertToLocalDiagnostics(Document targetDocu
var
version
=
await
GetDiagnosticVersionAsync
(
project
,
cancellationToken
).
ConfigureAwait
(
false
);
var
existingData
=
await
ProjectAnalysisData
.
CreateAsync
(
project
,
stateSets
,
avoidLoadingData
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
existingData
.
Version
==
version
)
// we can't return here if we have open file only analyzers sine saved data for open file only analyzer
// is wrong. (since it only contains info on open files rather than whole project)
if
(
existingData
.
Version
==
version
&&
!
analyzerDriverOpt
.
ContainsOpenFileOnlyAnalyzers
(
project
.
Solution
.
Workspace
))
{
return
existingData
;
}
// perf optimization. check whether we want to analyze this project or not.
if
(!
FullAnalysisEnabled
(
project
,
ignoreFullAnalysisOptions
))
if
(!
FullAnalysisEnabled
(
project
,
forceAnalyzerRun
))
{
return
new
ProjectAnalysisData
(
project
.
Id
,
VersionStamp
.
Default
,
existingData
.
Result
,
ImmutableDictionary
<
DiagnosticAnalyzer
,
DiagnosticAnalysisResult
>.
Empty
);
}
...
...
@@ -225,7 +227,7 @@ public IEnumerable<DiagnosticData> ConvertToLocalDiagnostics(Document targetDocu
// this can happen since caller could have created the driver with different set of analyzers that are different
// than what we used to create the cache.
var
version
=
await
GetDiagnosticVersionAsync
(
project
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
TryReduceAnalyzersToRun
(
analyzerDriverOpt
,
version
,
existing
,
out
var
analyzersToRun
))
if
(
TryReduceAnalyzersToRun
(
analyzerDriverOpt
,
project
,
version
,
existing
,
out
var
analyzersToRun
))
{
// it looks like we can reduce the set. create new CompilationWithAnalyzer.
// if we reduced to 0, we just pass in null for analyzer drvier. it could be reduced to 0
...
...
@@ -272,7 +274,7 @@ public IEnumerable<DiagnosticData> ConvertToLocalDiagnostics(Document targetDocu
}
private
bool
TryReduceAnalyzersToRun
(
CompilationWithAnalyzers
analyzerDriverOpt
,
VersionStamp
version
,
CompilationWithAnalyzers
analyzerDriverOpt
,
Project
project
,
VersionStamp
version
,
ImmutableDictionary
<
DiagnosticAnalyzer
,
DiagnosticAnalysisResult
>
existing
,
out
ImmutableArray
<
DiagnosticAnalyzer
>
analyzers
)
{
...
...
@@ -289,13 +291,15 @@ public IEnumerable<DiagnosticData> ConvertToLocalDiagnostics(Document targetDocu
foreach
(
var
analyzer
in
existingAnalyzers
)
{
if
(
existing
.
TryGetValue
(
analyzer
,
out
var
analysisResult
)
&&
analysisResult
.
Version
==
version
)
analysisResult
.
Version
==
version
&&
!
analyzer
.
IsOpenFileOnly
(
project
.
Solution
.
Workspace
))
{
// we already have up to date result.
continue
;
}
// analyzer that is out of date.
// open file only analyzer is always out of date for project wide data
builder
.
Add
(
analyzer
);
}
...
...
@@ -483,9 +487,9 @@ private async Task<bool> SemanticAnalysisEnabled(Document document, DiagnosticAn
}
}
private
static
bool
FullAnalysisEnabled
(
Project
project
,
bool
ignoreFullAnalysisOptions
)
private
static
bool
FullAnalysisEnabled
(
Project
project
,
bool
forceAnalyzerRun
)
{
if
(
ignoreFullAnalysisOptions
)
if
(
forceAnalyzerRun
)
{
// asked to ignore any checks.
return
true
;
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnostics.cs
浏览文件 @
6f68907c
...
...
@@ -397,8 +397,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
ignoreFullAnalysisOptions
=
true
;
var
result
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
ignoreFullAnalysisOptions
,
cancellationToken
).
ConfigureAwait
(
false
);
var
forceAnalyzerRun
=
true
;
var
result
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
forceAnalyzerRun
,
cancellationToken
).
ConfigureAwait
(
false
);
foreach
(
var
stateSet
in
stateSets
)
{
...
...
@@ -444,7 +444,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
ignoreFullAnalysisOptions
=
true
;
var
forceAnalyzerRun
=
true
;
var
analyzerDriverOpt
=
await
Owner
.
_compilationManager
.
CreateAnalyzerDriverAsync
(
project
,
stateSets
,
IncludeSuppressedDiagnostics
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
documentId
!=
null
)
...
...
@@ -462,7 +462,7 @@ private bool ShouldIncludeStateSet(Project project, StateSet stateSet)
}
case
AnalysisKind
.
NonLocal
:
{
var
nonLocalDocumentResult
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
ignoreFullAnalysisOptions
,
cancellationToken
).
ConfigureAwait
(
false
);
var
nonLocalDocumentResult
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
forceAnalyzerRun
,
cancellationToken
).
ConfigureAwait
(
false
);
var
analysisResult
=
nonLocalDocumentResult
.
GetResult
(
stateSet
.
Analyzer
);
return
GetResult
(
analysisResult
,
AnalysisKind
.
NonLocal
,
documentId
);
}
...
...
@@ -472,7 +472,7 @@ private bool ShouldIncludeStateSet(Project project, StateSet stateSet)
}
Contract
.
ThrowIfFalse
(
kind
==
AnalysisKind
.
NonLocal
);
var
projectResult
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
ignoreFullAnalysisOptions
,
cancellationToken
).
ConfigureAwait
(
false
);
var
projectResult
=
await
Owner
.
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
forceAnalyzerRun
,
cancellationToken
).
ConfigureAwait
(
false
);
return
projectResult
.
GetResult
(
stateSet
.
Analyzer
).
Others
;
}
}
...
...
src/Features/Core/Portable/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs
浏览文件 @
6f68907c
...
...
@@ -84,8 +84,8 @@ public async Task AnalyzeProjectAsync(Project project, bool semanticsChanged, In
var
includeSuppressedDiagnostics
=
true
;
var
analyzerDriverOpt
=
await
_compilationManager
.
CreateAnalyzerDriverAsync
(
project
,
activeAnalyzers
,
includeSuppressedDiagnostics
,
cancellationToken
).
ConfigureAwait
(
false
);
var
ignoreFullAnalysisOptions
=
false
;
var
result
=
await
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
ignoreFullAnalysisOptions
,
cancellationToken
).
ConfigureAwait
(
false
);
var
forceAnalyzerRun
=
false
;
var
result
=
await
_executor
.
GetProjectAnalysisDataAsync
(
analyzerDriverOpt
,
project
,
stateSets
,
forceAnalyzerRun
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
result
.
FromCache
)
{
RaiseProjectDiagnosticsIfNeeded
(
project
,
stateSets
,
result
.
Result
);
...
...
src/VisualStudio/Core/Test.Next/Services/VisualStudioDiagnosticAnalyzerExecutorTests.cs
浏览文件 @
6f68907c
...
...
@@ -157,7 +157,10 @@ void Method()
var
project
=
workspace
.
CurrentSolution
.
Projects
.
First
();
var
executor
=
(
ICodeAnalysisDiagnosticAnalyzerExecutor
)
new
DiagnosticAnalyzerExecutor
(
new
MyUpdateSource
(
workspace
)).
CreateService
(
workspace
.
Services
);
var
analyzerDriver
=
(
await
project
.
GetCompilationAsync
()).
WithAnalyzers
(
analyzerReference
.
GetAnalyzers
(
project
.
Language
).
Where
(
a
=>
a
.
GetType
()
==
analyzerType
).
ToImmutableArray
());
var
analyzerDriver
=
(
await
project
.
GetCompilationAsync
()).
WithAnalyzers
(
analyzerReference
.
GetAnalyzers
(
project
.
Language
).
Where
(
a
=>
a
.
GetType
()
==
analyzerType
).
ToImmutableArray
(),
new
WorkspaceAnalyzerOptions
(
project
.
AnalyzerOptions
,
project
.
Solution
.
Options
,
project
.
Solution
));
var
result
=
await
executor
.
AnalyzeAsync
(
analyzerDriver
,
project
,
CancellationToken
.
None
);
var
analyzerResult
=
result
.
AnalysisResult
[
analyzerDriver
.
Analyzers
[
0
]];
...
...
@@ -175,7 +178,10 @@ private static async Task<DiagnosticAnalysisResult> AnalyzeAsync(TestWorkspace w
var
analyzerReference
=
new
AnalyzerFileReference
(
analyzerType
.
Assembly
.
Location
,
new
TestAnalyzerAssemblyLoader
());
var
project
=
workspace
.
CurrentSolution
.
GetProject
(
projectId
).
AddAnalyzerReference
(
analyzerReference
);
var
analyzerDriver
=
(
await
project
.
GetCompilationAsync
()).
WithAnalyzers
(
analyzerReference
.
GetAnalyzers
(
project
.
Language
).
Where
(
a
=>
a
.
GetType
()
==
analyzerType
).
ToImmutableArray
());
var
analyzerDriver
=
(
await
project
.
GetCompilationAsync
()).
WithAnalyzers
(
analyzerReference
.
GetAnalyzers
(
project
.
Language
).
Where
(
a
=>
a
.
GetType
()
==
analyzerType
).
ToImmutableArray
(),
new
WorkspaceAnalyzerOptions
(
project
.
AnalyzerOptions
,
project
.
Solution
.
Options
,
project
.
Solution
));
var
result
=
await
executor
.
AnalyzeAsync
(
analyzerDriver
,
project
,
cancellationToken
);
return
result
.
AnalysisResult
[
analyzerDriver
.
Analyzers
[
0
]];
...
...
src/Workspaces/Core/Portable/Workspaces.csproj
浏览文件 @
6f68907c
...
...
@@ -14,8 +14,6 @@
<PackageTargetFallback>
portable-net45+win8;dotnet
</PackageTargetFallback>
<ProjectTypeGuids>
{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
</ProjectTypeGuids>
<ServiceablePackage>
true
</ServiceablePackage>
<!-- Temporary workaround for CLR bug, VSO #290723. Please remove the below line once this bug is fixed. -->
<SkipApplyOptimizations>
true
</SkipApplyOptimizations>
<DefineConstants>
$(DefineConstants);WORKSPACE
</DefineConstants>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"
/>
...
...
@@ -1155,4 +1153,4 @@
</ItemGroup>
<Import
Project=
"..\..\..\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems"
Label=
"Shared"
/>
<Import
Project=
"..\..\..\..\build\Targets\Imports.targets"
/>
</Project>
\ No newline at end of file
</Project>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录