SonarSource / sonar-scanner-msbuild

SonarScanner for .NET
http://redirect.sonarsource.com/doc/msbuild-sq-runner.html
GNU Lesser General Public License v3.0
357 stars 144 forks source link

Files generated and written to disc using SourceGenerators are not indexed by the scanner #1487

Open csaba-sagi-sonarsource opened 1 year ago

csaba-sagi-sonarsource commented 1 year ago

If a file is generated and written to the disc with the help of SourceGenerators (Parameters: EmitCompilerGeneratedFiles and CompilerGeneratedFilesOutputPath) the scanner does not recognize them and does not index them. This means the file is not going to show up in SC/SQ.

Keep in mind that even if this issue is fixed, issues will still not be reported correctly for those files, until this issue is fixed on roslyn side.

andrei-epure-sonarsource commented 1 year ago

Note: we have a parameter to analyze generated files (false by default), this can confuse users.