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

Function getAdjustedSpanFromNodes

test/fixtures/snapshot/typescript.js:160502–160509  ·  view source on GitHub ↗

* Includes the final semicolon so that the span covers statements in cases where it would otherwise * only cover the declaration list.

(startNode, endNode, sourceFile)

Source from the content-addressed store, hash-verified

160500 * only cover the declaration list.
160501 */
160502 function getAdjustedSpanFromNodes(startNode, endNode, sourceFile) {
160503 var start = startNode.getStart(sourceFile);
160504 var end = endNode.getEnd();
160505 if (sourceFile.text.charCodeAt(end) === 59 /* CharacterCodes.semicolon */) {
160506 end++;
160507 }
160508 return { start: start, length: end - start };
160509 }
160510 function getStatementOrExpressionRange(node) {
160511 if (ts.isStatement(node)) {
160512 return [node];

Callers 1

getRangeToExtractFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected