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

Function formatSpan

test/fixtures/snapshot/typescript.js:147229–147233  ·  view source on GitHub ↗
(originalRange, sourceFile, formatContext, requestKind)

Source from the content-addressed store, hash-verified

147227 return formatSpan(span, sourceFile, formatContext, requestKind);
147228 }
147229 function formatSpan(originalRange, sourceFile, formatContext, requestKind) {
147230 // find the smallest node that fully wraps the range and compute the initial indentation for the node
147231 var enclosingNode = findEnclosingNode(originalRange, sourceFile);
147232 return formatting.getFormattingScanner(sourceFile.text, sourceFile.languageVariant, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end, function (scanner) { return formatSpanWorker(originalRange, enclosingNode, formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, formatContext.options), getOwnOrInheritedDelta(enclosingNode, formatContext.options, sourceFile), scanner, formatContext, requestKind, prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), sourceFile); });
147233 }
147234 function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, _a, requestKind, rangeContainsError, sourceFile) {
147235 var _b;
147236 var options = _a.options, getRules = _a.getRules, host = _a.host;

Callers 5

formatOnEnterFunction · 0.85
formatOnOpeningCurlyFunction · 0.85
formatDocumentFunction · 0.85
formatSelectionFunction · 0.85
formatNodeLinesFunction · 0.85

Calls 5

findEnclosingNodeFunction · 0.85
getScanStartPositionFunction · 0.85
formatSpanWorkerFunction · 0.85
getOwnOrInheritedDeltaFunction · 0.85

Tested by

no test coverage detected