In dotnet/wpf#6792 (comment) we found a scenario where the build was passing in the exact same analyzer multiple times.
When the same source file is passed multiple times, we give a warning and drop the duplicated file:
|
// warning CS2002: Source file '{0}' specified multiple times |
|
diagnostics.Add(new DiagnosticInfo(MessageProvider, (int)ErrorCode.WRN_FileAlreadyIncluded, |
|
Arguments.PrintFullPaths ? normalizedFilePath : _diagnosticFormatter.RelativizeNormalizedPath(normalizedFilePath))); |
|
|
|
trees[i] = null; |
Perhaps we should do something similar for analyzers.
In dotnet/wpf#6792 (comment) we found a scenario where the build was passing in the exact same analyzer multiple times.
When the same source file is passed multiple times, we give a warning and drop the duplicated file:
roslyn/src/Compilers/CSharp/Portable/CommandLine/CSharpCompiler.cs
Lines 108 to 112 in df86b32
Perhaps we should do something similar for analyzers.