1 write to Token
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenData.cs (1)
35
this.
Token
= token;
56 references to Token
Microsoft.CodeAnalysis.CodeStyle (56)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (1)
574
if (_anchorBaseTokenMap.TryGetValue(tokenData.
Token
, out var tempAnchorData))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
280
if (context.IsFormattingDisabled(new TextSpan(context.TokenStream.LastTokenInStream.
Token
.SpanStart, 0)))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (5)
329
previousChangesMap[currentToken.
Token
] = triviaInfo.Spaces;
337
var spanBetweenTokens = TextSpan.FromBounds(previousToken.
Token
.Span.End, currentToken.
Token
.SpanStart);
507
if (previousChangesMap.ContainsKey(tokenWithIndex.
Token
))
530
var indentationDelta = context.GetDeltaFromPreviousChangesMap(tokenWithIndex.
Token
, previousChangesMap);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenData.cs (13)
45
=> this.
Token
.GetHashCode();
59
return this.
Token
.Equals(other.
Token
);
69
if (this.
Token
== other.
Token
)
72
var start = this.
Token
.SpanStart - other.
Token
.SpanStart;
76
var end = this.
Token
.Span.End - other.
Token
.Span.End;
83
var commonRoot = this.
Token
.GetCommonRoot(other.
Token
);
87
var thisTokenAncestor = GetAncestorUnderRoot(this.
Token
, commonRoot);
88
var otherTokenAncestor = GetAncestorUnderRoot(other.
Token
, commonRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (32)
97
return _treeData.IsFirstToken(this.FirstTokenInStream.
Token
);
106
return _treeData.IsLastToken(this.LastTokenInStream.
Token
);
156
var previousToken = tokenData.
Token
.GetPreviousToken(includeZeroWidth: true);
174
var nextToken = tokenData.
Token
.GetNextToken(includeZeroWidth: true);
189
token = previousTokenData.
Token
;
290
for (; previousToken.
Token
.RawKind != 0; previousToken = previousToken.GetPreviousTokenData())
303
GetTokenLength(previousToken.
Token
, out var tokenLength, out var multipleLines);
351
var token = this.FirstTokenInStream.
Token
;
369
var token = this.LastTokenInStream.
Token
;
379
if (_treeData.IsFirstToken(token2.
Token
))
384
if (_treeData.IsLastToken(token1.
Token
))
390
Debug.Assert(token1.
Token
.Span.End <= token2.
Token
.SpanStart);
392
Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.
Token
.Equals(token2.
Token
.GetPreviousToken(includeZeroWidth: true)) || token2.
Token
.LeadingTrivia.Span.Contains(token1.
Token
.Span));
406
if (_treeData.IsFirstToken(token2.
Token
))
408
return _factory.CreateLeadingTrivia(token2.
Token
);
410
else if (_treeData.IsLastToken(token1.
Token
))
412
return _factory.CreateTrailingTrivia(token1.
Token
);
415
Debug.Assert(token1.
Token
.Span.End <= token2.
Token
.SpanStart);
417
Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.
Token
.Equals(token2.
Token
.GetPreviousToken(includeZeroWidth: true)) || token2.
Token
.LeadingTrivia.Span.Contains(token1.
Token
.Span));
421
return _factory.Create(token1.
Token
, token2.
Token
);
435
Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.
Token
));
447
Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.
Token
));
489
if (tokenData1.
Token
.RawKind == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (4)
57
return CommonFormattingHelpers.HasAnyWhitespaceElasticTrivia(startToken.
Token
, nextToken.
Token
) ||
58
CommonFormattingHelpers.HasAnyWhitespaceElasticTrivia(previousToken.
Token
, endToken.
Token
);