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

Function processRange

test/fixtures/snapshot/typescript.js:147682–147700  ·  view source on GitHub ↗
(range, rangeStart, parent, contextNode, dynamicIndentation)

Source from the content-addressed store, hash-verified

147680 }
147681 }
147682 function processRange(range, rangeStart, parent, contextNode, dynamicIndentation) {
147683 var rangeHasError = rangeContainsError(range);
147684 var lineAction = 0 /* LineAction.None */;
147685 if (!rangeHasError) {
147686 if (!previousRange) {
147687 // trim whitespaces starting from the beginning of the span up to the current line
147688 var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos);
147689 trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line);
147690 }
147691 else {
147692 lineAction =
147693 processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation);
147694 }
147695 }
147696 previousRange = range;
147697 previousParent = parent;
147698 previousRangeStartLine = rangeStart.line;
147699 return lineAction;
147700 }
147701 function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) {
147702 formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode);
147703 var rules = getRules(formattingContext);

Callers 3

formatSpanWorkerFunction · 0.85
processTriviaFunction · 0.85

Calls 2

processPairFunction · 0.85

Tested by

no test coverage detected