protected SyntaxToken InsertMissingToken(SyntaxKind preferred, SyntaxKind[] otherOptions) { var missingTokenSourceRange = new SourceRange(Current.FullSourceRange.Start, 0); var diagnosticSpan = GetDiagnosticSourceRangeForMissingToken(); var diagnostics = new List <Diagnostic>(1); diagnostics.ReportTokenExpectedMultipleChoices(diagnosticSpan, Current, new[] { preferred }.Concat(otherOptions)); return(SyntaxToken.CreateMissing(preferred, missingTokenSourceRange, GetSourceFileSpan(missingTokenSourceRange)).WithDiagnostics(diagnostics)); }
protected SyntaxToken InsertMissingToken(SyntaxKind kind) { var missingTokenSourceRange = new SourceRange(Current.FullSourceRange.Start, 0); var diagnosticSpan = GetDiagnosticSourceRangeForMissingToken(); var diagnostics = new List <Diagnostic>(1); diagnostics.ReportTokenExpected(diagnosticSpan, Current, kind); return(SyntaxToken.CreateMissing(kind, missingTokenSourceRange, GetSourceFileSpan(missingTokenSourceRange)).WithDiagnostics(diagnostics)); }
internal static SyntaxToken MissingToken(SyntaxKind kind, params RazorDiagnostic[] diagnostics) { return(SyntaxToken.CreateMissing(kind, diagnostics)); }