language-support

Solid

Adding tree-sitter language coverage

AI & Automation 98 stars 21 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
66
Recency 20%
100
Frontmatter 20%
40
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Language Support Use this to add a new language to basemind's extraction. Supported languages today include Rust, Python, TypeScript/JSX, JavaScript, Go. ## Inputs needed - A tree-sitter grammar crate (e.g. `tree-sitter-elixir`) reachable via the `tree-sitter-language-pack` umbrella crate basemind already depends on, or as a direct dep. - The grammar's upstream `queries/tags.scm` from the tree-sitter org repo — it's the canonical starting point for symbol + reference extraction. ## Steps 1. **Register the language** - Add the lang ID + file extensions to `src/lang.rs`'s language registry. - Add the extensions to the scanner's accepted-extension set in `src/scanner.rs` (or the central glob if one exists). 2. **L1 (outline) queries** - Adapt the upstream `tags.scm` to basemind's L1 capture shape: `@symbol.function`, `@symbol.method`, `@symbol.class`, etc. mapped to `extract::SymbolKind`. - Place query string in `src/queries/<lang>.rs` (or under `src/extract/queries/`, matching the existing layout). - Wire into `extract::l1::extract`'s language dispatch. 3. **L2 (calls) queries** - Add a call query: callees as `@call.callee` plus optional receiver / type info. - Wire into `extract::l2::extract`'s dispatch. Remember to populate `start_row` / `start_col` on `Call`. 4. **Fixtures + smoke test** - Add a synthetic file under `tests/fixtures/<lang>/` exercising at least: one function def, one method, one call site, one import. - Add assertions in `...

Details

Author
Goldziher
Repository
Goldziher/basemind
Created
2 years ago
Last Updated
yesterday
Language
Rust
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category