@@ -131,64 +131,6 @@ private async Task<string> GetCompilationErrorsAsync(MSBuildWorkspace workspace,
131131 return errorString ;
132132 }
133133
134- private async Task < List < Diagnostic > > GetDiagnosticsAsync ( Project project )
135- {
136- Compilation ? compilation = await project . GetCompilationAsync ( ) ;
137- if ( compilation is null ) {
138- var collection = Diagnostic . Create ( "FAIL" , "Compilation" , "Compilation is null" , DiagnosticSeverity . Error , DiagnosticSeverity . Error , true , 3 ) ;
139- return new List < Diagnostic > { collection } ;
140- }
141-
142- ImmutableArray < Diagnostic > compileDiagnostics = compilation . GetDiagnostics ( ) ;
143-
144- var analyzers = project . AnalyzerReferences
145- . SelectMany ( r => r . GetAnalyzersForAllLanguages ( ) )
146- . ToImmutableArray ( ) ;
147-
148- ImmutableArray < Diagnostic > analyzerDiagnostics = ImmutableArray < Diagnostic > . Empty ;
149- if ( ! analyzers . IsEmpty )
150- {
151- var compWithAnalyzers = compilation . WithAnalyzers ( analyzers ) ;
152- analyzerDiagnostics = await compWithAnalyzers . GetAllDiagnosticsAsync ( ) ;
153- }
154-
155- var allDiagnostics = compileDiagnostics
156- . Concat ( analyzerDiagnostics )
157- . ToList ( ) ;
158-
159- return allDiagnostics ;
160- }
161-
162- private void HandleWorkspaceFailure ( object ? sender , WorkspaceDiagnosticEventArgs e )
163- {
164- if ( e . Diagnostic . Kind == WorkspaceDiagnosticKind . Failure &&
165- ! e . Diagnostic . Message . Contains ( "SDK Resolver Failure" ) &&
166- ! e . Diagnostic . Message . Contains ( ".NETFramework,Version=v4.8" ) )
167- {
168- var diagnostic = Diagnostic . Create (
169- id : e . Diagnostic . Kind . ToString ( ) ,
170- category : "Workspace" ,
171- message : e . Diagnostic . Message ,
172- severity : DiagnosticSeverity . Error ,
173- defaultSeverity : DiagnosticSeverity . Error ,
174- isEnabledByDefault : true ,
175- warningLevel : 0 ) ;
176- _loadDiagnostics . Add ( diagnostic ) ;
177- }
178- else if ( e . Diagnostic . Kind == WorkspaceDiagnosticKind . Warning )
179- {
180- var diagnostic = Diagnostic . Create (
181- id : e . Diagnostic . Kind . ToString ( ) ,
182- category : "Workspace" ,
183- message : e . Diagnostic . Message ,
184- severity : DiagnosticSeverity . Warning ,
185- defaultSeverity : DiagnosticSeverity . Warning ,
186- isEnabledByDefault : true ,
187- warningLevel : 1 ) ;
188- _loadDiagnostics . Add ( diagnostic ) ;
189- }
190- }
191-
192134 private async Task RunDotnetRestoreAsync ( string path )
193135 {
194136 var processStartInfo = new ProcessStartInfo
0 commit comments