MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / heading

Function heading

crates/chat-cli/src/cli/chat/parse.rs:213–230  ·  view source on GitHub ↗
(
    mut o: impl Write + 'b,
    state: &'b mut ParseState,
)

Source from the content-addressed store, hash-verified

211}
212
213fn heading<'a, 'b>(
214 mut o: impl Write + 'b,
215 state: &'b mut ParseState,
216) -> impl FnMut(&mut Partial<&'a str>) -> PResult<(), Error<'a>> + 'b {
217 move |i| {
218 if !state.newline {
219 return Err(ErrMode::from_error_kind(i, ErrorKind::Fail));
220 }
221
222 let level = terminated(take_while(1.., |c| c == '#'), space1).parse_next(i)?;
223 let print = format!("{level} ");
224
225 queue_newline_or_advance(&mut o, state, print.width())?;
226 queue(&mut o, StyledText::emphasis_fg())?;
227 queue(&mut o, style::SetAttribute(Attribute::Bold))?;
228 queue(&mut o, style::Print(print))
229 }
230}
231
232fn bulleted_item<'a, 'b>(
233 mut o: impl Write + 'b,

Callers

nothing calls this directly

Calls 2

queue_newline_or_advanceFunction · 0.85
queueFunction · 0.85

Tested by

no test coverage detected