How neovim/tree-sitter-vimdoc works
Project type and purpose
• This is a language‐grammar/parser project built on the Tree-sitter framework.
• Its goal is to parse Vim’s help-file format (“vimdoc”) into a stable AST, then expose that parser via multiple language bindings (C, Go, Node, Python, Rust, Swift).
File structure
• Top-level “src” and “grammar.js”: the core grammar definition and generated C parser.
• “bindings/…”: six subfolders, each holding glue code for a specific language (C, Go, Node, Python, Rust, Swift).
• “queries/vimdoc”: Tree-sitter query files for syntax highlighting and injections.
• “test/corpus”: example vimdoc files used to validate the grammar.
• Build/config files: Makefile, binding.gyp, Cargo.toml, setup.py, package.json, pyproject.toml, Package.swift—support multi-language packaging and CI.
• .github/workflows: CI pipelines for testing and releasing across languages.
README for additional insights
• Describes the vimdoc spec, AST node types, and key design decisions (e.g., “predictable output,” codeblock handling).
• Outlines a release workflow that spans Cargo, npm, pip, and Swift Package Manager.