MCPcopy Index your code
hub / github.com/Effect-TS/effect / renderNextFrame

Function renderNextFrame

packages/cli/src/internal/prompt/text.ts:144–161  ·  view source on GitHub ↗
(state: State, options: Options)

Source from the content-addressed store, hash-verified

142}
143
144function renderNextFrame(state: State, options: Options) {
145 return Effect.gen(function*() {
146 const terminal = yield* Terminal.Terminal
147 const columns = yield* terminal.columns
148 const figures = yield* InternalAnsiUtils.figures
149 const leadingSymbol = Doc.annotate(Doc.text("?"), Ansi.cyanBright)
150 const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.blackBright)
151 const promptMsg = renderOutput(state, leadingSymbol, trailingSymbol, options)
152 const errorMsg = renderError(state, figures.pointerSmall)
153 const offset = state.cursor - state.value.length
154 return promptMsg.pipe(
155 Doc.cat(errorMsg),
156 Doc.cat(Doc.cursorMove(offset)),
157 Optimize.optimize(Optimize.Deep),
158 Doc.render({ style: "pretty", options: { lineWidth: columns } })
159 )
160 })
161}
162
163function renderSubmission(state: State, options: Options) {
164 return Effect.gen(function*() {

Callers 1

handleRenderFunction · 0.70

Calls 5

renderOutputFunction · 0.70
renderErrorFunction · 0.70
annotateMethod · 0.65
pipeMethod · 0.65
textMethod · 0.45

Tested by

no test coverage detected