Skip to content

Commit d077ce4

Browse files
Arthurvdvclaude
andauthored
fix: upgrade ALCops.Analyzers to v0.8.6 and improve AD0001 handling (#11)
Resolves #10 — LinterCop analyzer crashed with MissingMethodException when the AL Language extension provides newer BC DevTools than what ALCops.Analyzers v0.5.0 was compiled against. The reflection-based wrapper for QuoteIdentifierIfNeeded was introduced in v0.6.0+. - Bump ALCops.Analyzers from 0.5.0 to 0.8.6 - Log AD0001 (analyzer crash) diagnostics to stderr for debugging while still including them in results - Log BC DevTools version at startup for easier triage - Add Dependabot config scoped to ALCops.Analyzers Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cae30f3 commit d077ce4

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: nuget
4+
directory: /src/ALCops.Mcp
5+
schedule:
6+
interval: weekly
7+
allow:
8+
- dependency-name: ALCops.Analyzers

src/ALCops.Mcp/ALCops.Mcp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<PackageReference Include="ModelContextProtocol" Version="0.9.0-preview.2" />
2727
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
2828
<PackageReference Include="System.Composition.AttributedModel" Version="8.0.0" />
29-
<PackageReference Include="ALCops.Analyzers" Version="0.5.0" PrivateAssets="none" />
29+
<PackageReference Include="ALCops.Analyzers" Version="0.8.6" PrivateAssets="none" />
3030
</ItemGroup>
3131

3232
<!-- BC Dev Tools — needed at compile time, excluded from package by ExcludeBcDevToolsFromPublish.

src/ALCops.Mcp/Services/BcDevToolsBootstrap.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ internal static class BcDevToolsBootstrap
2121
{
2222
RegisterAssemblyResolver(path);
2323
Console.Error.WriteLine($"BC DevTools: {path}");
24+
try
25+
{
26+
var version = System.Diagnostics.FileVersionInfo
27+
.GetVersionInfo(Path.Combine(path, MarkerDll));
28+
Console.Error.WriteLine($"BC DevTools version: {version.FileVersion}");
29+
}
30+
catch { /* non-critical */ }
2431
}
2532
else
2633
{

src/ALCops.Mcp/Services/DiagnosticsRunner.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public async Task<IReadOnlyList<DiagnosticResult>> RunAsync(
6262
if (diagnostic.IsSuppressed)
6363
continue;
6464

65+
if (diagnostic.Id == "AD0001")
66+
Console.Error.WriteLine($"Analyzer exception: {diagnostic.GetMessage()}");
67+
6568
// Ruleset filter: suppress diagnostics set to None, override severity for others
6669
var effectiveSeverity = diagnostic.Severity;
6770
if (provider is AnalyzerSet analyzerSet && analyzerSet.RuleActions is { } ruleActions)

0 commit comments

Comments
 (0)