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

Function renderOutput

packages/cli/src/internal/prompt/text.ts:121–142  ·  view source on GitHub ↗
(
  nextState: State,
  leadingSymbol: Doc.AnsiDoc,
  trailingSymbol: Doc.AnsiDoc,
  options: Options,
  submitted: boolean = false
)

Source from the content-addressed store, hash-verified

119}
120
121function renderOutput(
122 nextState: State,
123 leadingSymbol: Doc.AnsiDoc,
124 trailingSymbol: Doc.AnsiDoc,
125 options: Options,
126 submitted: boolean = false
127) {
128 const annotateLine = (line: string): Doc.AnsiDoc => Doc.annotate(Doc.text(line), Ansi.bold)
129 const promptLines = options.message.split(/\r?\n/)
130 const prefix = Doc.cat(leadingSymbol, Doc.space)
131 if (Arr.isNonEmptyReadonlyArray(promptLines)) {
132 const lines = Arr.map(promptLines, (line) => annotateLine(line))
133 return prefix.pipe(
134 Doc.cat(Doc.nest(Doc.vsep(lines), 2)),
135 Doc.cat(Doc.space),
136 Doc.cat(trailingSymbol),
137 Doc.cat(Doc.space),
138 Doc.cat(renderInput(nextState, options, submitted))
139 )
140 }
141 return Doc.hsep([prefix, trailingSymbol, renderInput(nextState, options, submitted)])
142}
143
144function renderNextFrame(state: State, options: Options) {
145 return Effect.gen(function*() {

Callers 2

renderNextFrameFunction · 0.70
renderSubmissionFunction · 0.70

Calls 5

splitMethod · 0.80
annotateLineFunction · 0.70
renderInputFunction · 0.70
mapMethod · 0.65
pipeMethod · 0.65

Tested by

no test coverage detected