Beispiel #1
0
        private Diagnostic AnalyzeNonFormatCall(MemberAccessExpressionSyntax methodCall, ArgumentSyntax argument, SemanticModel semanticModel, string proposedMethodName)
        {
            // check for correct type (only ILog methods shall be reported)
            var type = methodCall.GetTypeSymbol(semanticModel);

            if (type.Name == Constants.ILog.TypeName && argument.IsException(semanticModel))
            {
                var enclosingMethod = methodCall.GetEnclosingMethod(semanticModel);

                return(Issue(enclosingMethod.Name, methodCall.Name, proposedMethodName));
            }

            return(null);
        }