FSharp.Analyzers.SDK icon indicating copy to clipboard operation
FSharp.Analyzers.SDK copied to clipboard

Does the SDK discriminate between debug/release mode? Does it matter?

Open cmeeren opened this issue 1 year ago • 1 comments

While working on an analyzer that uses the TAST, it occurred to me that maybe the TAST could be different in debug/release mode (e.g. due to optimizations). Is this the case? If so, how can I test my analyzer in debug vs. release mode, and what determines which mode FSharp.Analyzers.SDK uses?

cmeeren avatar Apr 09 '23 10:04 cmeeren

In an editor, which 'mode' is going to be determined by the 'Configuration' chosen by the user. In any FSAC-based editor, that configuration will always be Debug, but Rider/VS/etc have more sophistication here.

In the CLI, that is determined by the Configuration MSBuild property. The Analyzer CLI doesn't have a -p flag to set properties (probably a good idea to add this) but MSBuild will gladly read properties from the environment and so if a user set Configuration=Release in their environment before calling the CLI then that's what the Configuration would be.

baronfel avatar Sep 10 '23 19:09 baronfel