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

Function renderAutoCompleteFilter

packages/effect/src/cli/Prompt.ts:3335–3349  ·  view source on GitHub ↗
(
  state: AutoCompleteState,
  options: AutoCompleteOptionsReq<A>,
  theme: Theme,
  renderOptions?: RenderOptions | undefined
)

Source from the content-addressed store, hash-verified

3333 header === undefined ? body : header + "\n" + body
3334
3335const renderAutoCompleteFilter = <A>(
3336 state: AutoCompleteState,
3337 options: AutoCompleteOptionsReq<A>,
3338 theme: Theme,
3339 renderOptions?: RenderOptions | undefined
3340) => {
3341 const filterValue = state.query.length === 0
3342 ? renderOptions?.plain === true
3343 ? options.filterPlaceholder
3344 : Ansi.annotate(theme.colors, options.filterPlaceholder, theme.mutedColor)
3345 : renderOptions?.plain === true
3346 ? state.query
3347 : Ansi.annotate(theme.colors, state.query, Ansi.combine(Ansi.underlined, theme.primaryColor))
3348 return `[${options.filterLabel}: ${filterValue}]`
3349}
3350
3351const renderAutoCompleteOutput = <A>(
3352 state: AutoCompleteState,

Callers 1

renderAutoCompleteOutputFunction · 0.85

Calls 2

annotateMethod · 0.65
combineMethod · 0.65

Tested by

no test coverage detected