public static void ReportTokenExpected(this ICollection <Diagnostic> diagnostics, SourceRange sourceRange, SyntaxToken actual, SyntaxKind expected) { var actualText = actual.GetDisplayText(); var expectedText = expected.GetDisplayText(); diagnostics.Report(sourceRange, DiagnosticId.TokenExpected, actualText, expectedText); }
public static void ReportTokenExpectedMultipleChoices(this ICollection <Diagnostic> diagnostics, SourceRange sourceRange, SyntaxToken actual, IEnumerable <SyntaxKind> expected) { var actualText = actual.GetDisplayText(); var expectedText = string.Join(", ", expected.Select(x => $"'{x.GetDisplayText()}'")); diagnostics.Report(sourceRange, DiagnosticId.TokenExpectedMultipleChoices, actualText, expectedText); }
public static void ReportTokenUnexpected(this ICollection<Diagnostic> diagnostics, TextSpan span, SyntaxToken actual) { var actualText = actual.GetDisplayText(); diagnostics.Report(span, DiagnosticId.TokenUnexpected, actualText); }
public static void ReportTokenUnexpected(this ICollection <Diagnostic> diagnostics, TextSpan span, SyntaxToken actual) { var actualText = actual.GetDisplayText(); diagnostics.Report(span, DiagnosticId.TokenUnexpected, actualText); }
public static void ReportTokenExpectedMultipleChoices(this ICollection<Diagnostic> diagnostics, TextSpan span, SyntaxToken actual, IEnumerable<SyntaxKind> expected) { var actualText = actual.GetDisplayText(); var expectedText = string.Join(", ", expected.Select(x => $"'{x.GetDisplayText()}'")); diagnostics.Report(span, DiagnosticId.TokenExpectedMultipleChoices, actualText, expectedText); }