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