1- #nullable enable
2-
31using System . IO ;
42using Buildalyzer . IO ;
53using Microsoft . CodeAnalysis ;
@@ -32,7 +30,7 @@ public static CompilerCommand Parse(DirectoryInfo? baseDir, string commandLine,
3230 {
3331 Text = commandLine ,
3432 CompilerLocation = location ,
35- Arguments = args . ToImmutableArray ( ) ,
33+ Arguments = [ .. args ] ,
3634 } ;
3735
3836 static CompilerCommand Parse ( string ? baseDir , string ? root , string [ ] args , CompilerLanguage language ) => language switch
@@ -85,9 +83,9 @@ public static FSharpCompilerCommand Parse(string[] args)
8583
8684 return new ( )
8785 {
88- MetadataReferences = metadataReferences . ToImmutableArray ( ) ,
89- PreprocessorSymbolNames = preprocessorSymbolNames . ToImmutableArray ( ) ,
90- SourceFiles = sourceFiles . ToImmutableArray ( ) ,
86+ MetadataReferences = [ .. metadataReferences ] ,
87+ PreprocessorSymbolNames = [ .. preprocessorSymbolNames ] ,
88+ SourceFiles = [ .. sourceFiles ] ,
9189 } ;
9290 }
9391 }
@@ -99,14 +97,14 @@ public static TCommand Enrich<TCommand>(TCommand command, CommandLineArguments a
9997
10098 => command with
10199 {
102- AnalyzerReferences = arguments . AnalyzerReferences . Select ( AsIOPath ) . ToImmutableArray ( ) ,
103- AnalyzerConfigPaths = arguments . AnalyzerConfigPaths . Select ( IOPath . Parse ) . ToImmutableArray ( ) ,
104- MetadataReferences = arguments . MetadataReferences . Select ( m => m . Reference ) . ToImmutableArray ( ) ,
100+ AnalyzerReferences = [ .. arguments . AnalyzerReferences . Select ( AsIOPath ) ] ,
101+ AnalyzerConfigPaths = [ .. arguments . AnalyzerConfigPaths . Select ( IOPath . Parse ) ] ,
102+ MetadataReferences = [ .. arguments . MetadataReferences . Select ( m => m . Reference ) ] ,
105103 Aliases = arguments . MetadataReferences . Where ( m => ! m . Properties . Aliases . IsEmpty ) . ToImmutableDictionary ( m => m . Reference , m => m . Properties . Aliases ) ,
106- PreprocessorSymbolNames = arguments . ParseOptions . PreprocessorSymbolNames . ToImmutableArray ( ) ,
107- SourceFiles = arguments . SourceFiles . Select ( AsIOPath ) . ToImmutableArray ( ) ,
108- AdditionalFiles = arguments . AdditionalFiles . Select ( AsIOPath ) . ToImmutableArray ( ) ,
109- EmbeddedFiles = arguments . EmbeddedFiles . Select ( AsIOPath ) . ToImmutableArray ( ) ,
104+ PreprocessorSymbolNames = [ .. arguments . ParseOptions . PreprocessorSymbolNames ] ,
105+ SourceFiles = [ .. arguments . SourceFiles . Select ( AsIOPath ) ] ,
106+ AdditionalFiles = [ .. arguments . AdditionalFiles . Select ( AsIOPath ) ] ,
107+ EmbeddedFiles = [ .. arguments . EmbeddedFiles . Select ( AsIOPath ) ] ,
110108 } ;
111109 }
112110
0 commit comments