private static void CheckIfLocationOfExpressionAndOpenTokenAreTheSame(SyntaxNodeAnalysisContext context, SyntaxToken openToken, ExpressionSyntax expression) { var identifierLine = expression.GetLineSpan(); var openParenLine = openToken.GetLineSpan(); if (identifierLine.IsValid && openParenLine.IsValid && openParenLine.StartLinePosition.Line != identifierLine.StartLinePosition.Line) { context.ReportDiagnostic(Diagnostic.Create(Descriptor, openToken.GetLocation())); } }