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

Function code

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

Source from the content-addressed store, hash-verified

287}
288
289fn code<'a, 'b>(
290 mut o: impl Write + 'b,
291 state: &'b mut ParseState,
292) -> impl FnMut(&mut Partial<&'a str>) -> PResult<(), Error<'a>> + 'b {
293 move |i| {
294 "`".parse_next(i)?;
295 let code = terminated(take_until(0.., "`"), "`").parse_next(i)?;
296 let out = code.replace("&amp;", "&").replace("&gt;", ">").replace("&lt;", "<");
297
298 queue_newline_or_advance(&mut o, state, out.width())?;
299 queue(&mut o, StyledText::success_fg())?;
300 queue(&mut o, style::Print(out))?;
301 queue(&mut o, StyledText::reset())
302 }
303}
304
305fn blockquote<'a, 'b>(
306 mut o: impl Write + 'b,

Callers 15

fmtMethod · 0.85
fmtMethod · 0.85
codeMethod · 0.85
fmtMethod · 0.85
codeMethod · 0.85
fmtMethod · 0.85
codeMethod · 0.85
fmtMethod · 0.85
codeMethod · 0.85
fmtMethod · 0.85
codeMethod · 0.85
fmtMethod · 0.85

Calls 2

queue_newline_or_advanceFunction · 0.85
queueFunction · 0.85

Tested by 4

fmtMethod · 0.68
codeMethod · 0.68
fmtMethod · 0.68
codeMethod · 0.68