async def METHOD_NAME(
    stack: Stack,
    visual: bool,
    maybe_grammar: str = REPL_GRAMMAR,
) -> None:
    try:
        grammar = SnippetGrammar[maybe_grammar]
    except KeyError:
        grammar = SnippetGrammar.lsp
        log.warn("%s", "bad snippet grammar -- reverting to LSP")
    win = await Window.get_current()
    buf = await win.get_buf()
    line_count = await buf.line_count()
    path = PurePath(normcase(await buf.get_name() or ""))
    comment_str = await buf.commentstr() or ("", "")
    clipboard = await Nvim.fn.getreg(str)
    info = ParseInfo(visual="", clipboard=clipboard, comment_str=comment_str)
    if visual:
        (lo, _), (hi, _) = await operator_marks(buf=buf, visual_type=None)
        hi = min(line_count, hi + 1)
    else:
        lo, hi = 0, line_count
    lines = await buf.get_lines(lo=lo, hi=hi)
    try:
        compiled = compile_one(
            stack,
            grammar=grammar,
            path=path,
            info=info,
            lines=enumerate(lines, start=lo + 1),
        )
    except (LoadError, ParseError) as e:
        preview = str(e).splitlines()
        async with hold_win(win=win):
            await set_preview(syntax="", preview=preview)
        await Nvim.write(LANG("snip parse fail"))
    else:
        preview = _pprn(compiled).splitlines()
        async with hold_win(win=win):
            await set_preview(syntax="yaml", preview=preview)
        if preview:
            await Nvim.write(LANG("snip parse succ"))
        else:
            await Nvim.write(LANG("no snippets found"))
        with suppress(NvimError, LoadError, ParseError):
            await Nvim.exec(":silent! write")
            await compile_user_snippets(stack)
            await slurp_compiled(stack, warn=frozenset(), silent=True)