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

Function formatNodeLines

test/fixtures/snapshot/typescript.js:147219–147228  ·  view source on GitHub ↗
(node, sourceFile, formatContext, requestKind)

Source from the content-addressed store, hash-verified

147217 }
147218 formatting.formatNodeGivenIndentation = formatNodeGivenIndentation;
147219 function formatNodeLines(node, sourceFile, formatContext, requestKind) {
147220 if (!node) {
147221 return [];
147222 }
147223 var span = {
147224 pos: ts.getLineStartPositionForPosition(node.getStart(sourceFile), sourceFile),
147225 end: node.end
147226 };
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);

Callers 2

formatOnSemicolonFunction · 0.85
formatOnClosingCurlyFunction · 0.85

Calls 1

formatSpanFunction · 0.85

Tested by

no test coverage detected