emmylua_parser_desc

Crates.ioemmylua_parser_desc
lib.rsemmylua_parser_desc
version0.16.0
created_at2025-08-08 11:19:17.847273+00
updated_at2025-09-19 11:19:57.078117+00
descriptionA parser for markup within Lua comments
homepage
repositoryhttps://github.com/CppCXY/emmylua-analyzer-rust
max_upload_size
id1786608
size304,513
(CppCXY)

documentation

README

EmmyLua-Parser-Desc

EmmyLua-Parser-Desc is an extension for EmmyLua-Parser that uses its internal machinery to provide lexic information about markup of documentation comments. It supports parsing Markdown, MyST and RST.

Features

  • Ability to parse description blocks provided by EmmyLua-Parser and report ranges of interest: highlighted keywords, code blocks, cross-references and so on
  • Supports Markdown, MyST and RST
  • Ability to parse possible broken or unterminated MyST and RST cross-references in order to facilitate Autocompletion and Go To Definition functionality

Usage

let code = r#"
    --- Description in **markdown format**, with example code:
    ---
    --- ```lua
    --- print(a)
    --- ```
    local a = 1
"#;
let tree = LuaParser::parse(code, ParserConfig::default());

let chunk = tree.get_chunk_node();
for desc in chunk.descendants::<LuaDocDescription>() {
    let doc_items = emmylua_parser_desc::parse(
        DescParserType::Md,
        code,
        desc,
        None
    );
    println!("{:?}", doc_items);
}
Commit count: 1999

cargo fmt