MCPcopy Create free account
hub / github.com/Effect-TS/effect / renderSubmission

Function renderSubmission

packages/cli/src/internal/prompt/file.ts:219–234  ·  view source on GitHub ↗
(value: string, options: FileOptions)

Source from the content-addressed store, hash-verified

217}
218
219function renderSubmission(value: string, options: FileOptions) {
220 return Effect.gen(function*() {
221 const terminal = yield* Terminal.Terminal
222 const columns = yield* terminal.columns
223 const figures = yield* InternalAnsiUtils.figures
224 const leadingSymbol = Doc.annotate(figures.tick, Ansi.green)
225 const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.blackBright)
226 const promptMsg = renderPrompt(Doc.empty, options.message, leadingSymbol, trailingSymbol)
227 return promptMsg.pipe(
228 Doc.cat(Doc.space),
229 Doc.cat(Doc.annotate(Doc.text(value), Ansi.white)),
230 Doc.cat(Doc.hardLine),
231 Doc.render({ style: "pretty", options: { lineWidth: columns } })
232 )
233 })
234}
235
236function handleRender(options: FileOptions) {
237 return (_: State, action: Prompt.Prompt.Action<State, string>) => {

Callers 1

handleRenderFunction · 0.70

Calls 4

renderPromptFunction · 0.85
annotateMethod · 0.65
pipeMethod · 0.65
textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…