Skip to content

Commit

Permalink
chore: Add warnings for UnresolvedAnalyzerReference
Browse files Browse the repository at this point in the history
  • Loading branch information
filzrev committed Jan 18, 2024
1 parent 1d9ad29 commit 9f68b9f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Docfx.Dotnet/DotnetApiCatalog.Compile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Logging;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.MSBuild;

#nullable enable
Expand Down Expand Up @@ -132,6 +133,11 @@ await LoadCompilationFromProject(project.AbsolutePath) is { } compilation)
await Process.Start("dotnet", $"restore \"{path}\"").WaitForExitAsync();
}
project = await workspace.OpenProjectAsync(path, msbuildLogger);

foreach (var unresolvedAnalyzer in project.AnalyzerReferences.OfType<UnresolvedAnalyzerReference>())
{
Logger.LogWarning("There is .NET Analyzer that can't be resolved. Path: " + unresolvedAnalyzer.FullPath);
}
}

if (!project.SupportsCompilation)
Expand Down

0 comments on commit 9f68b9f

Please sign in to comment.