public ParametersCounterSymbolWalker(SyntaxNodeAnalysisContext aSyntaxContext, PXContext aPxContext) { syntaxContext = aSyntaxContext; cancellationToken = syntaxContext.CancellationToken; isAcumatica2018R2 = aPxContext.IsAcumatica2018R2; if (isAcumatica2018R2) { iViewConfig2018R2 = aPxContext.IViewConfig2018R2; } ParametersCounter = new ParametersCounter(aPxContext); }
public ParametersCounterSymbolWalker(SyntaxNodeAnalysisContext syntaxContext, PXContext pxContext) { _syntaxContext = syntaxContext; _cancellationToken = _syntaxContext.CancellationToken; _isAcumatica2018R2 = pxContext.IsAcumatica2018R2; if (_isAcumatica2018R2) { _iViewConfig2018R2 = pxContext.IViewConfig2018R2; } ParametersCounter = new ParametersCounter(pxContext); }
private static void VerifyBqlArgumentsCount(int argsCount, ParametersCounter parametersCounter, SyntaxNodeAnalysisContext syntaxContext, InvocationExpressionSyntax invocation, IMethodSymbol methodSymbol, PXContext pxContext) { syntaxContext.CancellationToken.ThrowIfCancellationRequested(); if (!parametersCounter.IsCountingValid) { return; } int searchMethodParametersCount = 0; if (methodSymbol.Name == SearchMethodName && methodSymbol.IsGenericMethod) { searchMethodParametersCount = methodSymbol.TypeParameters.Length; } int maxCount = parametersCounter.OptionalParametersCount + parametersCounter.RequiredParametersCount + searchMethodParametersCount; int minCount = parametersCounter.RequiredParametersCount + searchMethodParametersCount; if (argsCount < minCount || argsCount > maxCount) { Location location = invocation.GetMethodNameLocation(); if (parametersCounter.OptionalParametersCount == 0) { syntaxContext.ReportDiagnosticWithSuppressionCheck(Diagnostic.Create( Descriptors.PX1015_PXBqlParametersMismatchWithOnlyRequiredParams, location, methodSymbol.Name, minCount), pxContext.CodeAnalysisSettings); } else { syntaxContext.ReportDiagnosticWithSuppressionCheck(Diagnostic.Create( Descriptors.PX1015_PXBqlParametersMismatchWithRequiredAndOptionalParams, location, methodSymbol.Name, minCount, maxCount), pxContext.CodeAnalysisSettings); } } }
public ParametersCounterSyntaxWalker(SyntaxNodeAnalysisContext aSyntaxContext, PXContext aPxContext) { syntaxContext = aSyntaxContext; cancellationToken = syntaxContext.CancellationToken; ParametersCounter = new ParametersCounter(aPxContext); }