MCPcopy Index your code
hub / github.com/prettier/prettier / formatDoc

Function formatDoc

src/main/core.js:391–399  ·  view source on GitHub ↗
(doc, options)

Source from the content-addressed store, hash-verified

389
390// Doesn't handle shebang for now
391async function formatDoc(doc, options) {
392 const text = printDocToDebug(doc);
393 const { formatted } = await formatWithCursor(text, {
394 ...options,
395 parser: "__js_expression",
396 });
397
398 return formatted;
399}
400
401async function printToDoc(originalText, options) {
402 options = await normalizeFormatOptions(options);

Callers 1

debug-api.jsFile · 0.85

Calls 2

printDocToDebugFunction · 0.90
formatWithCursorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…