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

Function characterToColumn

test/fixtures/snapshot/typescript.js:147760–147771  ·  view source on GitHub ↗
(startLinePosition, characterInLine)

Source from the content-addressed store, hash-verified

147758 }
147759 }
147760 function characterToColumn(startLinePosition, characterInLine) {
147761 var column = 0;
147762 for (var i = 0; i < characterInLine; i++) {
147763 if (sourceFile.text.charCodeAt(startLinePosition + i) === 9 /* CharacterCodes.tab */) {
147764 column += options.tabSize - column % options.tabSize;
147765 }
147766 else {
147767 column++;
147768 }
147769 }
147770 return column;
147771 }
147772 function indentationIsDifferent(indentationString, startLinePosition) {
147773 return indentationString !== sourceFile.text.substr(startLinePosition, indentationString.length);
147774 }

Callers 1

insertIndentationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected