1 type derived from SyntaxDiagnosticInfo
Microsoft.CodeAnalysis.CSharp (1)
Errors\XmlSyntaxDiagnosticInfo.cs (1)
11internal sealed class XmlSyntaxDiagnosticInfo : SyntaxDiagnosticInfo
24 instantiations of SyntaxDiagnosticInfo
Microsoft.CodeAnalysis.CSharp (21)
Errors\SyntaxDiagnosticInfo.cs (2)
56return new SyntaxDiagnosticInfo(offset, this.Width, (ErrorCode)this.Code, this.Arguments); 67return new SyntaxDiagnosticInfo(this, severity);
Parser\AbstractLexer.cs (4)
94return new SyntaxDiagnosticInfo(offset, width, code); 100return new SyntaxDiagnosticInfo(offset, width, code, args); 119return new SyntaxDiagnosticInfo(code); 124return new SyntaxDiagnosticInfo(code, args);
Parser\DocumentationCommentParser.cs (4)
796SyntaxDiagnosticInfo crefInfo = new SyntaxDiagnosticInfo(rawInfo.Offset, rawInfo.Width, ErrorCode.WRN_ErrorOverride, rawInfo, rawInfo.Code); 1040SyntaxDiagnosticInfo rawInfo = new SyntaxDiagnosticInfo(offset, width, ErrorCode.ERR_OvlOperatorExpected); 1041SyntaxDiagnosticInfo crefInfo = new SyntaxDiagnosticInfo(offset, width, ErrorCode.WRN_ErrorOverride, rawInfo, rawInfo.Code); 1377new SyntaxDiagnosticInfo(ErrorCode.ERR_TypeParamMustBeIdentifier), $"{(int)ErrorCode.ERR_TypeParamMustBeIdentifier:d4}");
Parser\Lexer.cs (2)
1993var error = new SyntaxDiagnosticInfo(offset: 0, width: 1, code: ErrorCode.ERR_BadDirectivePlacement); 4841return new SyntaxDiagnosticInfo(start - this.LexemeStartPosition,
Parser\SyntaxParser.cs (8)
679return new SyntaxDiagnosticInfo(offset, width, code, SyntaxFacts.GetText(expected)); 683return new SyntaxDiagnosticInfo(offset, width, code, /*unused*/string.Empty, SyntaxFacts.GetText(actual)); 687return new SyntaxDiagnosticInfo(offset, width, code); 938return new SyntaxDiagnosticInfo(offset, width, code); 943return new SyntaxDiagnosticInfo(offset, width, code, args); 948return new SyntaxDiagnosticInfo(offset: 0, node.Width, code, args); 953return new SyntaxDiagnosticInfo(code, args); 1094new SyntaxDiagnosticInfo(finalDiagnosticOffset, diagnostic.Width, (ErrorCode)diagnostic.Code, diagnostic.Arguments));
Syntax\InternalSyntax\SyntaxFirstTokenReplacer.cs (1)
75new SyntaxDiagnosticInfo(
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (3)
Diagnostics\DiagnosticTest.cs (1)
121verifyWithSeverity(new SyntaxDiagnosticInfo(1, 2, ErrorCode.ERR_DuplicateTypeParameter, args));
Diagnostics\LocationsTests.cs (2)
557var nodeWithBadError = node.Green.WithDiagnosticsGreen(new DiagnosticInfo[] { new SyntaxDiagnosticInfo(10, 10, ErrorCode.ERR_NoBaseClass) }).CreateRed(); 586var nodeWithBadError = SyntaxFactory.IdentifierName(new SyntaxToken(node.Node.WithDiagnosticsGreen(new DiagnosticInfo[] { new SyntaxDiagnosticInfo(10, 10, ErrorCode.ERR_NoBaseClass) })));
58 references to SyntaxDiagnosticInfo
Microsoft.CodeAnalysis.CSharp (58)
Errors\SyntaxDiagnosticInfo.cs (2)
54public SyntaxDiagnosticInfo WithOffset(int offset) 59protected SyntaxDiagnosticInfo(SyntaxDiagnosticInfo original, DiagnosticSeverity severity) : base(original, severity)
Parser\AbstractLexer.cs (8)
19private List<SyntaxDiagnosticInfo>? _errors; 43protected SyntaxDiagnosticInfo[]? GetErrors() 78protected void AddError(SyntaxDiagnosticInfo? error) 84_errors = new List<SyntaxDiagnosticInfo>(8); 91protected SyntaxDiagnosticInfo MakeError(int position, int width, ErrorCode code) 97protected SyntaxDiagnosticInfo MakeError(int position, int width, ErrorCode code, params object[] args) 117protected static SyntaxDiagnosticInfo MakeError(ErrorCode code) 122protected static SyntaxDiagnosticInfo MakeError(ErrorCode code, params object[] args)
Parser\DocumentationCommentParser.cs (6)
790protected override SyntaxDiagnosticInfo GetExpectedTokenError(SyntaxKind expected, SyntaxKind actual, int offset, int length) 795SyntaxDiagnosticInfo rawInfo = base.GetExpectedTokenError(expected, actual, offset, length); 796SyntaxDiagnosticInfo crefInfo = new SyntaxDiagnosticInfo(rawInfo.Offset, rawInfo.Width, ErrorCode.WRN_ErrorOverride, rawInfo, rawInfo.Code); 810protected override SyntaxDiagnosticInfo GetExpectedMissingNodeOrTokenError( 1040SyntaxDiagnosticInfo rawInfo = new SyntaxDiagnosticInfo(offset, width, ErrorCode.ERR_OvlOperatorExpected); 1041SyntaxDiagnosticInfo crefInfo = new SyntaxDiagnosticInfo(offset, width, ErrorCode.WRN_ErrorOverride, rawInfo, rawInfo.Code);
Parser\LanguageParser.cs (4)
3912SyntaxDiagnosticInfo diagInfo = MakeError(opTokenErrorOffset, opTokenErrorWidth, ErrorCode.ERR_BadOperatorSyntax, SyntaxFacts.GetText(SyntaxKind.PlusToken)); 3983SyntaxDiagnosticInfo diagInfo = MakeError(opTokenErrorOffset, opTokenErrorWidth, ErrorCode.ERR_OvlUnaryOperatorExpected); 3991SyntaxDiagnosticInfo diagInfo = MakeError(opTokenErrorOffset, opTokenErrorWidth, ErrorCode.ERR_OvlBinaryOperatorExpected); 3999SyntaxDiagnosticInfo diagInfo = MakeError(opTokenErrorOffset, opTokenErrorWidth, ErrorCode.ERR_OvlOperatorExpected);
Parser\LanguageParser_InterpolatedString.cs (7)
51rescanInterpolation(out var kind, out var error, out var openQuoteRange, interpolations, out var closeQuoteRange); 66void rescanInterpolation(out Lexer.InterpolatedStringKind kind, out SyntaxDiagnosticInfo? error, out Range openQuoteRange, ArrayBuilder<Lexer.Interpolation> interpolations, out Range closeQuoteRange) 110var indentationError = getInterpolationIndentationError(indentationWhitespace, interpolation); 171SyntaxDiagnosticInfo? indentationError = null; 272SyntaxDiagnosticInfo? getInterpolationIndentationError( 478var sd = (SyntaxDiagnosticInfo)info;
Parser\Lexer.cs (12)
327private SyntaxToken Create(in TokenInfo info, SyntaxListBuilder? leading, SyntaxListBuilder? trailing, SyntaxDiagnosticInfo[]? errors) 696NextCharOrUnicodeEscape(out _, out var error); 1540SyntaxDiagnosticInfo? error; 1564SyntaxDiagnosticInfo? error; 1702SyntaxDiagnosticInfo? error; 1993var error = new SyntaxDiagnosticInfo(offset: 0, width: 1, code: ErrorCode.ERR_BadDirectivePlacement); 2696SyntaxDiagnosticInfo? error; 4599SyntaxDiagnosticInfo? info; 4606private char NextCharOrUnicodeEscape(out char surrogateCharacter, out SyntaxDiagnosticInfo? info) 4625private char NextUnicodeEscape(out char surrogateCharacter, out SyntaxDiagnosticInfo? info) 4630private char ScanUnicodeEscape(bool peek, out char surrogateCharacter, out SyntaxDiagnosticInfo? info) 4839private SyntaxDiagnosticInfo CreateIllegalEscapeDiagnostic(int start)
Parser\Lexer_StringLiteral.cs (5)
180SyntaxDiagnosticInfo? error; 273out var error, 283out SyntaxDiagnosticInfo? error, 347public SyntaxDiagnosticInfo? Error = null; 367private void TrySetError(SyntaxDiagnosticInfo error)
Parser\SyntaxParser.cs (11)
674protected virtual SyntaxDiagnosticInfo GetExpectedTokenError(SyntaxKind expected, SyntaxKind actual, int offset, int width) 691protected virtual SyntaxDiagnosticInfo GetExpectedMissingNodeOrTokenError( 936protected static SyntaxDiagnosticInfo MakeError(int offset, int width, ErrorCode code) 941protected static SyntaxDiagnosticInfo MakeError(int offset, int width, ErrorCode code, params object[] args) 946protected static SyntaxDiagnosticInfo MakeError(GreenNode node, ErrorCode code, params object[] args) 951protected static SyntaxDiagnosticInfo MakeError(ErrorCode code, params object[] args) 1041SyntaxDiagnosticInfo diagnostic = null; 1063var existing = (SyntaxDiagnosticInfo)token.GetDiagnostics().FirstOrDefault(); 1080var existing = (SyntaxDiagnosticInfo)node.GetDiagnostics().FirstOrDefault();
Syntax\InternalSyntax\SyntaxFirstTokenReplacer.cs (2)
72SyntaxDiagnosticInfo oldSyntaxDiagnostic = oldDiagnostic as SyntaxDiagnosticInfo;
Syntax\SyntaxTreeDiagnosticEnumerator.cs (1)
50foreach (SyntaxDiagnosticInfo sdi in node.GetDiagnostics())