public int? FromAlignTokensOperations(SyntaxTree tree, SyntaxToken token) { // let's check whether there is any missing token under us and whether // there is an align token operation for that missing token. var nextToken = token.GetNextToken(includeZeroWidth: true); if (nextToken.RawKind != 0 && nextToken.Width() <= 0) { // looks like we have one. find whether there is a align token operation for this token var alignmentBaseToken = GetAlignmentBaseTokenFor(nextToken); if (alignmentBaseToken.RawKind != 0) { return tree.GetTokenColumn(alignmentBaseToken, _tabSize); } } return null; }
public int GetIndentationOfCurrentPosition( SyntaxTree tree, SyntaxToken token, int position, int extraSpaces, CancellationToken cancellationToken) { // gather all indent operations var list = GetParentIndentBlockOperations(token); return GetIndentationOfCurrentPosition( tree.GetRoot(cancellationToken), token, list, position, extraSpaces, t => tree.GetTokenColumn(t, _tabSize), cancellationToken); }