Skip to content
LogoLogo

tree-sitter-toolang

tree-sitter-toolang is the Tree-sitter grammar package for Toolang .too files. This page shows what the package is for, where it lives, and how to use it from common Tree-sitter tools. Version 0.3.1 supports the agic, flow, and with syntax used by Toolang 0.3.

GitHub: openhat-ai/tree-sitter-toolang

Use cases

Use this package when a Tree-sitter-based tool needs to parse Toolang source.

  • syntax highlighting
  • structural search
  • outline and tag generation
  • editor integrations
  • scripts that inspect .too files

If you only want Toolang support in Zed, use zed-toolang.

Package names

  • npm: tree-sitter-toolang
  • PyPI: tree-sitter-toolang
  • Cargo: tree-sitter-toolang

Tree-sitter identifiers:

  • language name: toolang
  • scope: source.toolang
  • file extension: .too

Tree-sitter CLI

Clone the grammar:

git clone https://github.com/openhat-ai/tree-sitter-toolang.git

Add the parent directory containing tree-sitter-toolang to the parser-directories list in your Tree-sitter config (tree-sitter init-config creates one). Installing the npm package alone does not register it for CLI discovery. Then verify discovery:

tree-sitter dump-languages

Use it with .too files:

tree-sitter parse path/to/file.too
tree-sitter highlight path/to/file.too
tree-sitter tags path/to/file.too

Python

python -m pip install tree-sitter-toolang tree-sitter
import tree_sitter_toolang
from tree_sitter import Language, Parser
 
language = Language(tree_sitter_toolang.language())
parser = Parser(language)
tree = parser.parse(b"agic summarize(_) -> Text:\n    user: Summarize {{_}}\n")
assert not tree.root_node.has_error

The Python package also exports HIGHLIGHTS_QUERY, INJECTIONS_QUERY, INDENTS_QUERY, OUTLINE_QUERY, and TAGS_QUERY.

Rust

[dependencies]
tree-sitter = "0.25"
tree-sitter-toolang = "0.3.1"
let language = tree_sitter::Language::new(tree_sitter_toolang::LANGUAGE);
© 2026 Toolang