@@ -97,7 +97,8 @@ public static ExitCode Run(string[] args)
9797 stopwatch . Start ( ) ;
9898
9999 var options = Options . CreateWithEnvironment ( args ) ;
100- Entities . Compilation . Settings = ( Directory . GetCurrentDirectory ( ) , options . CompilerArguments . ToArray ( ) ) ;
100+ var workingDirectory = Directory . GetCurrentDirectory ( ) ;
101+ var compilerArgs = options . CompilerArguments . ToArray ( ) ;
101102
102103 using var logger = MakeLogger ( options . Verbosity , options . Console ) ;
103104
@@ -123,15 +124,15 @@ public static ExitCode Run(string[] args)
123124
124125 var compilerArguments = CSharpCommandLineParser . Default . Parse (
125126 compilerVersion . ArgsWithResponse ,
126- Entities . Compilation . Settings . Cwd ,
127+ workingDirectory ,
127128 compilerVersion . FrameworkPath ,
128129 compilerVersion . AdditionalReferenceDirectories
129130 ) ;
130131
131132 if ( compilerArguments is null )
132133 {
133134 var sb = new StringBuilder ( ) ;
134- sb . Append ( " Failed to parse command line: " ) . AppendList ( " " , Entities . Compilation . Settings . Args ) ;
135+ sb . Append ( " Failed to parse command line: " ) . AppendList ( " " , compilerArgs ) ;
135136 logger . Log ( Severity . Error , sb . ToString ( ) ) ;
136137 ++ analyser . CompilationErrors ;
137138 return ExitCode . Failed ;
@@ -143,7 +144,7 @@ public static ExitCode Run(string[] args)
143144 return ExitCode . Ok ;
144145 }
145146
146- return AnalyseTracing ( analyser , compilerArguments , options , canonicalPathCache , stopwatch ) ;
147+ return AnalyseTracing ( workingDirectory , compilerArgs , analyser , compilerArguments , options , canonicalPathCache , stopwatch ) ;
147148 }
148149 catch ( Exception ex ) // lgtm[cs/catch-of-all-exceptions]
149150 {
@@ -376,6 +377,8 @@ public static ExitCode Analyse(Stopwatch stopwatch, Analyser analyser, CommonOpt
376377 }
377378
378379 private static ExitCode AnalyseTracing (
380+ string cwd ,
381+ string [ ] args ,
379382 TracingAnalyser analyser ,
380383 CSharpCommandLineArguments compilerArguments ,
381384 Options options ,
@@ -420,7 +423,7 @@ private static ExitCode AnalyseTracing(
420423 . WithMetadataImportOptions ( MetadataImportOptions . All )
421424 ) ;
422425 } ,
423- ( compilation , options ) => analyser . EndInitialize ( compilerArguments , options , compilation ) ,
426+ ( compilation , options ) => analyser . EndInitialize ( compilerArguments , options , compilation , cwd , args ) ,
424427 ( ) => { } ) ;
425428 }
426429
0 commit comments