Skip to content

Commit

Permalink
Move to new ManifestHelper AL v13
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthurvdv committed Feb 7, 2024
1 parent 2f0830d commit f55b06a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Design/Rule0033AppManifestRuntimeBehind.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Dynamics.Nav.Analyzers.Common.AppSourceCopConfiguration;
//using Microsoft.Dynamics.Nav.Analyzers.Common.AppSourceCopConfiguration; // AL Language v12
using Microsoft.Dynamics.Nav.Analyzers.Common; // AL Language v13
using Microsoft.Dynamics.Nav.CodeAnalysis;
using Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics;
using Microsoft.Dynamics.Nav.CodeAnalysis.Packaging;
Expand All @@ -15,7 +16,8 @@ class Rule0033AppManifestRuntimeBehind : DiagnosticAnalyzer

private void CheckAppManifestRuntime(CompilationAnalysisContext ctx)
{
NavAppManifest manifest = AppSourceCopConfigurationProvider.GetManifest(ctx.Compilation);
//NavAppManifest manifest = AppSourceCopConfigurationProvider.GetManifest(ctx.Compilation); // AL Language v12
NavAppManifest manifest = ManifestHelper.GetManifest(ctx.Compilation); // AL Language v13
if (manifest == null) return;
if (manifest.Runtime == null) return;
if (manifest.Application == null && manifest.Platform == null) return;
Expand Down
18 changes: 12 additions & 6 deletions Design/Rule0052and0053InternalProceduresNotReferenced.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
using Microsoft.Dynamics.Nav.CodeAnalysis.Symbols;
using Microsoft.Dynamics.Nav.CodeAnalysis.Syntax;
using Microsoft.Dynamics.Nav.CodeAnalysis.Packaging;
using Microsoft.Dynamics.Nav.Analyzers.Common.AppSourceCopConfiguration;
//using Microsoft.Dynamics.Nav.Analyzers.Common.AppSourceCopConfiguration; // AL Language v12
using Microsoft.Dynamics.Nav.Analyzers.Common; // AL Language v13
using System.Collections.Immutable;

namespace BusinessCentral.LinterCop.Design {
namespace BusinessCentral.LinterCop.Design
{
[DiagnosticAnalyzer]
public class Rule0052InternalProceduresNotReferencedAnalyzer : DiagnosticAnalyzer {
public class Rule0052InternalProceduresNotReferencedAnalyzer : DiagnosticAnalyzer
{

private class MethodSymbolAnalyzer : IDisposable {
private class MethodSymbolAnalyzer : IDisposable
{
private readonly PooledDictionary<IMethodSymbol, string> methodSymbols = PooledDictionary<IMethodSymbol, string>.GetInstance();

private readonly PooledDictionary<IMethodSymbol, string> internalMethodsUnused = PooledDictionary<IMethodSymbol, string>.GetInstance();
Expand All @@ -23,8 +27,10 @@ private class MethodSymbolAnalyzer : IDisposable {

public MethodSymbolAnalyzer(CompilationAnalysisContext compilationAnalysisContext)
{
NavAppManifest manifest = AppSourceCopConfigurationProvider.GetManifest(compilationAnalysisContext.Compilation);
if(manifest.InternalsVisibleTo != null && manifest.InternalsVisibleTo.Any()) {
//NavAppManifest manifest = AppSourceCopConfigurationProvider.GetManifest(compilationAnalysisContext.Compilation); // AL Language v12
NavAppManifest manifest = ManifestHelper.GetManifest(compilationAnalysisContext.Compilation); // AL Language v13
if (manifest.InternalsVisibleTo != null && manifest.InternalsVisibleTo.Any())
{
return;
}

Expand Down

0 comments on commit f55b06a

Please sign in to comment.