public GetOpenCurlyBraceIndentSize ( RToken openCurlyBraceToken, |
||
openCurlyBraceToken | RToken | |
tb | ||
options | Microsoft.R.Core.Formatting.RFormatOptions | |
Résultat | int |
public FormattingScope(TextBuilder tb, TokenStream<RToken> tokens, int openBraceTokenIndex, RFormatOptions options, BraceHandler braceHandler) { Debug.Assert(tokens[openBraceTokenIndex].TokenType == RTokenType.OpenCurlyBrace); _options = options; _tb = tb; _previousIndentLevel = tb.IndentBuilder.IndentLevel; CloseCurlyBraceTokenIndex = FindMatchingCloseBrace(tokens, openBraceTokenIndex); StartingLineIndentSize = braceHandler.GetOpenCurlyBraceIndentSize(tokens[openBraceTokenIndex], tb, options); if (StartingLineIndentSize > 0) { tb.IndentBuilder.SetIndentLevelForSize(StartingLineIndentSize + _options.IndentSize); } else { tb.IndentBuilder.NewIndentLevel(); } }
public FormattingScope(TextBuilder tb, TokenStream <RToken> tokens, int openBraceTokenIndex, RFormatOptions options, BraceHandler braceHandler) { Debug.Assert(tokens[openBraceTokenIndex].TokenType == RTokenType.OpenCurlyBrace); _options = options; _tb = tb; _previousIndentLevel = tb.IndentBuilder.IndentLevel; CloseCurlyBraceTokenIndex = FindMatchingCloseBrace(tokens, openBraceTokenIndex); StartingLineIndentSize = braceHandler.GetOpenCurlyBraceIndentSize(tokens[openBraceTokenIndex], tb, options); if (StartingLineIndentSize > 0) { tb.IndentBuilder.SetIndentLevelForSize(StartingLineIndentSize + _options.IndentSize); } else { tb.IndentBuilder.NewIndentLevel(); } }