( text, partialNextOptions, parentOptions, printAstToDoc, )
| 106 | } |
| 107 | |
| 108 | async function textToDoc( |
| 109 | text, |
| 110 | partialNextOptions, |
| 111 | parentOptions, |
| 112 | printAstToDoc, |
| 113 | ) { |
| 114 | const options = await normalizeFormatOptions( |
| 115 | { |
| 116 | ...parentOptions, |
| 117 | ...partialNextOptions, |
| 118 | parentParser: parentOptions.parser, |
| 119 | originalText: text, |
| 120 | // Improve this if we calculate the relative index |
| 121 | cursorOffset: undefined, |
| 122 | rangeStart: undefined, |
| 123 | rangeEnd: undefined, |
| 124 | }, |
| 125 | { passThrough: true }, |
| 126 | ); |
| 127 | |
| 128 | const { ast } = await parse(text, options); |
| 129 | const doc = await printAstToDoc(ast, options); |
| 130 | |
| 131 | return stripTrailingHardline(doc); |
| 132 | } |
| 133 | |
| 134 | export { printEmbeddedLanguages }; |
searching dependent graphs…