@@ -111,7 +111,7 @@ public static Project AddToWorkspace(this IAnalyzerResult analyzerResult, Worksp
111111 {
112112 ProjectReference projectReference = projectReferenceStack . Pop ( ) ;
113113 Project nestedProject = workspace . CurrentSolution . GetProject ( projectReference . ProjectId ) ;
114- if ( nestedProject is object && visitedProjectIds . Add ( nestedProject . Id ) )
114+ if ( nestedProject is not null && visitedProjectIds . Add ( nestedProject . Id ) )
115115 {
116116 foreach ( ProjectReference nestedProjectReference in nestedProject . ProjectReferences )
117117 {
@@ -257,20 +257,19 @@ private static CompilationOptions CreateCompilationOptions(IAnalyzerResult analy
257257 private static IEnumerable < ProjectReference > GetExistingProjectReferences ( IAnalyzerResult analyzerResult , Workspace workspace ) =>
258258 analyzerResult . ProjectReferences
259259 . Select ( x => workspace . CurrentSolution . Projects . FirstOrDefault ( y => y . FilePath . Equals ( x , StringComparison . OrdinalIgnoreCase ) ) )
260-
261260 . Where ( x => x != null )
262261 . Select ( x => new ProjectReference ( x . Id ) )
263- ?? Array . Empty < ProjectReference > ( ) ;
262+ ?? [ ] ;
264263
265264 private static IEnumerable < IProjectAnalyzer > GetReferencedAnalyzerProjects ( IAnalyzerResult analyzerResult ) =>
266265 analyzerResult . ProjectReferences
267266 . Select ( x => analyzerResult . Manager . Projects . TryGetValue ( x , out IProjectAnalyzer a ) ? a : analyzerResult . Manager . GetProject ( x ) )
268267 . Where ( x => x != null )
269- ?? Array . Empty < ProjectAnalyzer > ( ) ;
268+ ?? [ ] ;
270269
271270 private static IEnumerable < DocumentInfo > GetDocuments ( IAnalyzerResult analyzerResult , ProjectId projectId )
272271 {
273- string [ ] sourceFiles = analyzerResult . SourceFiles ?? Array . Empty < string > ( ) ;
272+ string [ ] sourceFiles = analyzerResult . SourceFiles ?? [ ] ;
274273 return GetDocuments ( sourceFiles , projectId ) ;
275274 }
276275
@@ -287,15 +286,15 @@ private static IEnumerable<DocumentInfo> GetDocuments(IEnumerable<string> files,
287286 private static IEnumerable < DocumentInfo > GetAdditionalDocuments ( IAnalyzerResult analyzerResult , ProjectId projectId )
288287 {
289288 string projectDirectory = Path . GetDirectoryName ( analyzerResult . ProjectFilePath ) ;
290- string [ ] additionalFiles = analyzerResult . AdditionalFiles ?? Array . Empty < string > ( ) ;
289+ string [ ] additionalFiles = analyzerResult . AdditionalFiles ?? [ ] ;
291290 return GetDocuments ( additionalFiles . Select ( x => Path . Combine ( projectDirectory ! , x ) ) , projectId ) ;
292291 }
293292
294293 private static IEnumerable < MetadataReference > GetMetadataReferences ( IAnalyzerResult analyzerResult ) =>
295294 analyzerResult
296295 . References ? . Where ( File . Exists )
297296 . Select ( x => MetadataReference . CreateFromFile ( x ) )
298- ?? ( IEnumerable < MetadataReference > ) Array . Empty < MetadataReference > ( ) ;
297+ ?? [ ] ;
299298
300299 private static IEnumerable < AnalyzerReference > GetAnalyzerReferences ( IAnalyzerResult analyzerResult , Workspace workspace )
301300 {
@@ -304,7 +303,7 @@ private static IEnumerable<AnalyzerReference> GetAnalyzerReferences(IAnalyzerRes
304303 string projectDirectory = Path . GetDirectoryName ( analyzerResult . ProjectFilePath ) ;
305304 return analyzerResult . AnalyzerReferences ? . Where ( x => File . Exists ( Path . GetFullPath ( x , projectDirectory ! ) ) )
306305 . Select ( x => new AnalyzerFileReference ( Path . GetFullPath ( x , projectDirectory ! ) , loader ) )
307- ?? ( IEnumerable < AnalyzerReference > ) Array . Empty < AnalyzerReference > ( ) ;
306+ ?? [ ] ;
308307 }
309308
310309 private static bool TryGetSupportedLanguageName ( string projectPath , out string languageName )
0 commit comments