FSharp.Analyzers.SDK
FSharp.Analyzers.SDK copied to clipboard
Does the SDK discriminate between debug/release mode? Does it matter?
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?
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.