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

Function formatSelection

test/fixtures/snapshot/typescript.js:147044–147051  ·  view source on GitHub ↗
(start, end, sourceFile, formatContext)

Source from the content-addressed store, hash-verified

147042 }
147043 formatting.formatDocument = formatDocument;
147044 function formatSelection(start, end, sourceFile, formatContext) {
147045 // format from the beginning of the line
147046 var span = {
147047 pos: ts.getLineStartPositionForPosition(start, sourceFile),
147048 end: end,
147049 };
147050 return formatSpan(span, sourceFile, formatContext, 1 /* FormattingRequestKind.FormatSelection */);
147051 }
147052 formatting.formatSelection = formatSelection;
147053 /**
147054 * Validating `expectedTokenKind` ensures the token was typed in the context we expect (eg: not a comment).

Callers

nothing calls this directly

Calls 1

formatSpanFunction · 0.85

Tested by

no test coverage detected