1 write to _context
Microsoft.CodeAnalysis.CodeStyle (1)
AbstractFormatEngine.OperationApplier.cs (1)
28_context = context;
71 references to _context
Microsoft.CodeAnalysis.CodeStyle (71)
AbstractFormatEngine.OperationApplier.cs (71)
54var triviaInfo = _context.TokenStream.GetTriviaData(pairIndex); 63var indentation = _context.GetBaseIndentation(_context.TokenStream.GetToken(pairIndex + 1)); 65var previousToken = _context.TokenStream.GetToken(pairIndex); 66_context.TokenStream.GetTokenLength(previousToken, out var tokenLength, out var multipleLines); 69var endColumnOfPreviousToken = multipleLines ? tokenLength : _context.TokenStream.GetCurrentColumn(previousToken) + tokenLength; 74Debug.Assert(!_context.IsFormattingDisabled(pairIndex)); 76_context.TokenStream.ApplyChange(pairIndex, triviaInfo.WithSpace(indentation - endColumnOfPreviousToken, _context, _formattingRules)); 86var triviaInfo = _context.TokenStream.GetTriviaData(pairIndex); 101Debug.Assert(!_context.IsFormattingDisabled(pairIndex)); 103_context.TokenStream.ApplyChange(pairIndex, triviaInfo.WithSpace(space, _context, _formattingRules)); 109var triviaInfo = _context.TokenStream.GetTriviaData(pairIndex); 116Debug.Assert(!_context.IsFormattingDisabled(pairIndex)); 118_context.TokenStream.ApplyChange(pairIndex, triviaInfo.WithSpace(operation.Space, _context, _formattingRules)); 124var triviaInfo = _context.TokenStream.GetTriviaData(pairIndex); 139Debug.Assert(!_context.IsFormattingDisabled(pairIndex)); 141_context.TokenStream.ApplyChange(pairIndex, triviaInfo.WithSpace(space, _context, _formattingRules)); 163if (_context.TokenStream.TwoTokensOnSameLine(_context.TokenStream.GetToken(pairIndex), 164_context.TokenStream.GetToken(pairIndex + 1))) 177var triviaInfo = _context.TokenStream.GetTriviaData(pairIndex); 179var indentation = _context.GetBaseIndentation(_context.TokenStream.GetToken(pairIndex + 1)); 187Debug.Assert(!_context.IsFormattingDisabled(pairIndex)); 190_context.TokenStream.ApplyChange(pairIndex, triviaInfo.WithLine(operation.Line, indentation, _context, _formattingRules, cancellationToken)); 197var triviaInfo = _context.TokenStream.GetTriviaData(pairIndex); 201var indentation = _context.GetBaseIndentation(_context.TokenStream.GetToken(pairIndex + 1)); 204Debug.Assert(!_context.IsFormattingDisabled(pairIndex)); 207_context.TokenStream.ApplyChange(pairIndex, triviaInfo.WithLine(operation.Line, indentation, _context, _formattingRules, cancellationToken)); 218Debug.Assert(!_context.IsFormattingDisabled(new TextSpan(_context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0))); 220_context.TokenStream.ApplyChange(pairIndex, triviaInfo.WithIndentation(indentation, _context, _formattingRules, cancellationToken)); 286if (!ApplyAlignment(_context.TokenStream.FirstTokenOfBaseTokenLine(operation.BaseToken), operation.Tokens, previousChangesMap, out tokenData, cancellationToken)) 310var baseSpaceOrIndentation = _context.TokenStream.GetCurrentColumn(token); 315var previousToken = _context.TokenStream.GetPreviousTokenData(currentToken); 317var triviaInfo = _context.TokenStream.GetTriviaData(previousToken, currentToken); 347if (_context.IsSpacingSuppressed(spanBetweenTokens, triviaInfo.TreatAsElastic)) 352if (_context.IsFormattingDisabled(spanBetweenTokens)) 358_context.TokenStream.ApplyChange( 360triviaInfo.WithIndentation(baseSpaceOrIndentation, _context, _formattingRules, cancellationToken)); 374var tokenWithIndex = _context.TokenStream.GetTokenData(token); 397var endAnchorToken = _context.GetEndTokenForAnchorSpan(firstToken); 405var lastToken = _context.TokenStream.GetTokenData(endAnchorToken); 408lastToken = _context.TokenStream.LastTokenInStream; 427var triviaInfo = _context.TokenStream.GetTriviaData(pairIndex); 434if (_context.IsSpacingSuppressed(pairIndex)) 442var currentToken = _context.TokenStream.GetToken(pairIndex + 1); 470Debug.Assert(!_context.IsFormattingDisabled(pairIndex)); 477_context.TokenStream.ApplyChange(pairIndex, triviaInfo.WithIndentation(indentation, _context, _formattingRules, cancellationToken)); 489var baseTokenWithIndex = _context.TokenStream.GetTokenData(baseToken); 490var firstTokenWithIndex = _context.TokenStream.GetTokenData(startToken).GetPreviousTokenData(); 491var lastTokenWithIndex = _context.TokenStream.GetTokenData(endToken); 524_context.TokenStream.GetTriviaData(tokenPairIndex).SecondTokenIsFirstTokenOnLine) 539var indentationDelta = _context.GetDeltaFromPreviousChangesMap(tokenWithIndex.Token, previousChangesMap); 545startToken = startToken.IndexInStream < 0 ? _context.TokenStream.FirstTokenInStream : startToken; 546endToken = endToken.IndexInStream < 0 ? _context.TokenStream.LastTokenInStream : endToken; 555var triviaInfo = _context.TokenStream.GetTriviaData(pairIndex); 563if (_context.IsSpacingSuppressed(pairIndex)) 568var firstTokenOnLine = _context.TokenStream.GetToken(pairIndex + 1); 569var indentation = triviaInfo.Spaces + _context.GetAnchorDeltaFromOriginalColumn(firstTokenOnLine); 577_context.TokenStream.ApplyChange(pairIndex, triviaInfo.WithIndentation(indentation, _context, _formattingRules, cancellationToken));