MCPcopy Create free account
hub / github.com/nodejs/node / calculateIndent

Function calculateIndent

test/fixtures/snapshot/typescript.js:18862–18875  ·  view source on GitHub ↗
(text, pos, end)

Source from the content-addressed store, hash-verified

18860 }
18861 }
18862 function calculateIndent(text, pos, end) {
18863 var currentLineIndent = 0;
18864 for (; pos < end && ts.isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) {
18865 if (text.charCodeAt(pos) === 9 /* CharacterCodes.tab */) {
18866 // Tabs = TabSize = indent size and go to next tabStop
18867 currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize());
18868 }
18869 else {
18870 // Single space
18871 currentLineIndent++;
18872 }
18873 }
18874 return currentLineIndent;
18875 }
18876 function hasEffectiveModifiers(node) {
18877 return getEffectiveModifierFlags(node) !== 0 /* ModifierFlags.None */;
18878 }

Callers 1

writeCommentRangeFunction · 0.85

Calls 1

getIndentSizeFunction · 0.85

Tested by

no test coverage detected