2 writes to Node
Microsoft.CodeAnalysis (2)
Syntax\SyntaxToken.cs (2)
34
Node
= token;
43
Node
= token;
145 references to Node
Microsoft.CodeAnalysis (93)
Syntax\SeparatedSyntaxListBuilder.cs (2)
78
Debug.Assert(separatorToken.
Node
is object);
81
_builder.AddInternal(separatorToken.
Node
);
Syntax\SyntaxNodeOrToken.cs (1)
776
return new SyntaxNodeOrToken(token.Parent, token.
Node
, token.Position, token.Index);
Syntax\SyntaxNodeOrTokenListBuilder.cs (2)
77
RoslynDebug.Assert(item.
Node
is object);
78
this.Add(item.
Node
);
Syntax\SyntaxToken.cs (70)
48
return GetType().Name + " " + (
Node
!= null ?
Node
.KindText : "None") + " " + ToString();
54
public int RawKind =>
Node
?.RawKind ?? 0;
59
public string Language =>
Node
?.Language ?? string.Empty;
71
internal int RawContextualKind =>
Node
?.RawContextualKind ?? 0;
84
Debug.Assert(
Node
is object);
85
return
Node
;
96
internal int Width =>
Node
?.Width ?? 0;
101
internal int FullWidth =>
Node
?.FullWidth ?? 0;
110
return
Node
!= null ? new TextSpan(Position +
Node
.GetLeadingTriviaWidth(),
Node
.Width) : default(TextSpan);
116
get { return
Node
!= null ? Position +
Node
.FullWidth : 0; }
127
get { return
Node
!= null ? Position +
Node
.GetLeadingTriviaWidth() : 0; }
140
public bool IsMissing =>
Node
?.IsMissing ?? false;
146
public object? Value =>
Node
?.GetValue();
152
public string ValueText =>
Node
?.GetValueText() ?? string.Empty;
163
return
Node
!= null ?
Node
.ToString() : string.Empty;
173
return
Node
!= null ?
Node
.ToFullString() : string.Empty;
181
Node
?.WriteTo(writer);
189
Node
?.WriteTo(writer, leading, trailing);
205
internal int LeadingWidth =>
Node
?.GetLeadingTriviaWidth() ?? 0;
210
internal int TrailingWidth =>
Node
?.GetTrailingTriviaWidth() ?? 0;
215
public bool ContainsDiagnostics =>
Node
?.ContainsDiagnostics ?? false;
220
public bool ContainsDirectives =>
Node
?.ContainsDirectives ?? false;
233
public bool HasStructuredTrivia =>
Node
?.ContainsStructuredTrivia ?? false;
240
public bool ContainsAnnotations =>
Node
?.ContainsAnnotations ?? false;
247
return
Node
?.HasAnnotations(annotationKind) ?? false;
255
return
Node
?.HasAnnotations(annotationKinds) ?? false;
263
return
Node
?.HasAnnotation(annotation) ?? false;
271
return
Node
?.GetAnnotations(annotationKind) ?? SpecializedCollections.EmptyEnumerable<SyntaxAnnotation>();
287
return
Node
?.GetAnnotations(annotationKinds) ?? SpecializedCollections.EmptyEnumerable<SyntaxAnnotation>();
310
if (this.
Node
!= null)
314
token:
Node
.WithAdditionalAnnotationsGreen(annotations),
340
if (this.
Node
!= null)
344
token:
Node
.WithoutAnnotationsGreen(annotations),
378
if (token.
Node
== null)
383
if (
Node
== null)
388
var annotations = this.
Node
.GetAnnotations();
393
token: token.
Node
.WithAdditionalAnnotationsGreen(annotations),
410
return
Node
!= null
411
? new SyntaxTriviaList(this,
Node
.GetLeadingTriviaCore(), this.Position)
424
if (
Node
== null)
429
var leading =
Node
.GetLeadingTriviaCore();
436
var trailingGreen =
Node
.GetTrailingTriviaCore();
479
return
Node
!= null
480
? new SyntaxToken(null,
Node
.WithLeadingTrivia(GreenNode.CreateList(trivia, static t => t.RequiredUnderlyingNode)), position: 0, index: 0)
505
return
Node
!= null
506
? new SyntaxToken(null,
Node
.WithTrailingTrivia(GreenNode.CreateList(trivia, static t => t.RequiredUnderlyingNode)), position: 0, index: 0)
556
Node
== other.
Node
&&
575
return Hash.Combine(Parent, Hash.Combine(
Node
, Hash.Combine(Position, Index)));
584
if (
Node
== null)
601
if (
Node
== null)
615
if (
Node
== null)
659
if (
Node
== null)
668
var diagnostics =
Node
.GetDiagnostics();
684
(
Node
== null && token.
Node
== null) ||
685
(
Node
!= null && token.
Node
!= null &&
Node
.IsEquivalentTo(token.
Node
));
703
=> this.
Node
!= null && this.
Node
== token.
Node
;
Syntax\SyntaxTokenList.cs (10)
43
Node = token.
Node
;
79
case 1: return tokens[0].
Node
;
80
case 2: return Syntax.InternalSyntax.SyntaxList.List(tokens[0].
Node
!, tokens[1].
Node
!);
81
case 3: return Syntax.InternalSyntax.SyntaxList.List(tokens[0].
Node
!, tokens[1].
Node
!, tokens[2].
Node
!);
86
copy[i].Value = tokens[i].
Node
!;
103
Debug.Assert(token.
Node
is object);
104
builder.Add(token.
Node
);
Syntax\SyntaxTokenListBuilder.cs (3)
36
Debug.Assert(item.
Node
is object);
37
this.Add(item.
Node
);
68
_nodes[_count + i] = list[offset + i].
Node
;
Syntax\SyntaxTriviaList.Enumerator.cs (5)
57
Debug.Assert(token.
Node
is object);
58
var node = token.
Node
.GetLeadingTriviaCore();
68
Debug.Assert(token.
Node
is object);
69
var leading = token.
Node
.GetLeadingTriviaCore();
76
var trailingGreen = token.
Node
.GetTrailingTriviaCore();
Microsoft.CodeAnalysis.CSharp (13)
Compilation\CSharpSemanticModel.cs (1)
1322
if (firstToken.
Node
is object)
CSharpExtensions.cs (1)
329
return ((Syntax.InternalSyntax.CSharpSyntaxNode)token.
Node
!).ApplyDirectives(stack);
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
625
Debug.Assert(keyword.
Node
!= null || type != null);
630
var startSpan = modifiers.Node != null ? modifiers.Span : (keyword.
Node
!= null ? keyword.Span : type!.Span);
Parser\Blender.Reader.cs (2)
211
token: (InternalSyntax.SyntaxToken)currentNodeOrToken.AsToken().
Node
);
242
(nodeOrToken.IsToken && ((CSharpSyntaxNode)nodeOrToken.AsToken().
Node
).ContainsSkippedText && nodeOrToken.Parent.ContainsDiagnostics))
Syntax\CSharpSyntaxRewriter.cs (1)
61
var node = token.
Node
;
Syntax\CSharpSyntaxTree.cs (2)
818
if (token.
Node
== null)
822
return GetDiagnostics(token.
Node
, token.Position);
Syntax\ShebangDirectiveTriviaSyntax.cs (1)
25
.WithContent((InternalSyntax.SyntaxToken)content.
Node
!).CreateRed();
Syntax\SyntaxEquivalence.cs (3)
53
return before.RawKind == after.RawKind && (before.
Node
== null || AreTokensEquivalent(before.
Node
, after.
Node
, ignoreChildNode: null));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (39)
Diagnostics\LocationsTests.cs (1)
586
var nodeWithBadError = SyntaxFactory.IdentifierName(new SyntaxToken(node.
Node
.WithDiagnosticsGreen(new DiagnosticInfo[] { new SyntaxDiagnosticInfo(10, 10, ErrorCode.ERR_NoBaseClass) })));
Parsing\SyntaxExtensions.cs (3)
56
return ((Syntax.InternalSyntax.CSharpSyntaxNode)token.
Node
).ErrorsOrWarnings(errorsOnly: true);
61
return ((Syntax.InternalSyntax.CSharpSyntaxNode)token.
Node
).ErrorsOrWarnings(errorsOnly: false);
66
return ((Syntax.InternalSyntax.CSharpSyntaxNode)token.
Node
).ErrorsAndWarnings();
Syntax\SyntaxFactoryTests.cs (3)
197
var actualGreen = actualRed.
Node
;
224
Assert.IsType<InternalSyntax.SyntaxToken.SyntaxTokenWithTrivia>(token.
Node
);
228
Assert.IsType<InternalSyntax.SyntaxToken.SyntaxTokenWithValueAndTrivia<string>>(token.
Node
);
Syntax\SyntaxTokenListTests.cs (12)
25
EqualityTesting.AssertEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 0, 0), new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 0, 0));
28
EqualityTesting.AssertNotEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 0, 1), new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 0, 0));
31
EqualityTesting.AssertEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 1, 0), new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 0, 0));
41
EqualityTesting.AssertEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 0, 0).Reverse(), new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 0, 0).Reverse());
44
EqualityTesting.AssertNotEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 0, 1).Reverse(), new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 0, 0).Reverse());
47
EqualityTesting.AssertEqual(new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 1, 0).Reverse(), new SyntaxTokenList(node1, node1.ReturnKeyword.
Node
, 0, 0).Reverse());
Syntax\SyntaxTriviaListTests.cs (20)
25
EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.
Node
, 0, 0), new SyntaxTriviaList(node1, node1.
Node
, 0, 0));
26
EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node1.
Node
, 0, 1), new SyntaxTriviaList(node1, node1.
Node
, 0, 0));
27
EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node2.
Node
, 0, 0), new SyntaxTriviaList(node1, node1.
Node
, 0, 0));
28
EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node2, node1.
Node
, 0, 0), new SyntaxTriviaList(node1, node1.
Node
, 0, 0));
31
EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.
Node
, 1, 0), new SyntaxTriviaList(node1, node1.
Node
, 0, 0));
41
EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.
Node
, 0, 0).Reverse(), new SyntaxTriviaList(node1, node1.
Node
, 0, 0).Reverse());
42
EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node1.
Node
, 0, 1).Reverse(), new SyntaxTriviaList(node1, node1.
Node
, 0, 0).Reverse());
43
EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node1, node2.
Node
, 0, 0).Reverse(), new SyntaxTriviaList(node1, node1.
Node
, 0, 0).Reverse());
44
EqualityTesting.AssertNotEqual(new SyntaxTriviaList(node2, node1.
Node
, 0, 0).Reverse(), new SyntaxTriviaList(node1, node1.
Node
, 0, 0).Reverse());
47
EqualityTesting.AssertEqual(new SyntaxTriviaList(node1, node1.
Node
, 1, 0).Reverse(), new SyntaxTriviaList(node1, node1.
Node
, 0, 0).Reverse());