tree_sitter_language_pack 1.15.10 copy "tree_sitter_language_pack: ^1.15.10" to clipboard
tree_sitter_language_pack: ^1.15.10 copied to clipboard

Pre-compiled tree-sitter grammars for 371 programming languages

Xberg

Dart / Flutter #

Built with alef Rust Python Node.js WASM Java Go C# PHP Ruby Elixir Dart Kotlin Swift Zig C FFI
<!-- Project Info -->
<a href="https://github.com/xberg-io/tree-sitter-language-pack/blob/main/LICENSE">
	<img src="https://img.shields.io/badge/License-MIT-007ec6" alt="License" />
</a>
<a href="https://docs.tree-sitter-language-pack.xberg.io">
	<img src="https://img.shields.io/badge/Docs-tree--sitter--language--pack-007ec6" alt="Documentation" />
</a>

Dart / Flutter bindings for tree-sitter-language-pack — 371 pre-compiled tree-sitter grammars. Built with flutter_rust_bridge for isolate-safe Future APIs and Flutter-native type mapping.

What This Package Provides #

  • Parser access — load a tree-sitter language parser by name without wiring individual grammar crates or packages.
  • Code intelligence primitives — parse trees, functions, classes, imports, exports, symbols, docstrings, diagnostics, and syntax-aware chunks.
  • Shared cache model — parsers are fetched and cached once, then reused by every call in the process.
  • Same catalog as every binding — Rust, Python, Node.js, Go, Java, PHP, Ruby, .NET, Elixir, WASM, Dart, Kotlin Android, Swift, Zig, and C FFI use the same grammar set.
  • Dart package — flutter_rust_bridge Future APIs for Dart and Flutter.

Installation #

dart pub add tree_sitter_language_pack

Flutter projects use flutter pub add tree_sitter_language_pack instead.

Quick Start #

import 'dart:io';
import 'package:tree_sitter_language_pack/tree_sitter_language_pack.dart';
import 'package:tree_sitter_language_pack/src/tree_sitter_language_pack_bridge_generated/frb_generated.dart' show RustLib;
Future<void> main() async {
  await RustLib.init();
  try {
    final config = await createProcessConfigFromJson(json: '{"language":"python"}');
    final result = await TreeSitterLanguagePackBridge.process('# A comment\ndef greet(name):\n    """Say hello."""\n    return f\'Hi {name}\'\n\nimport os\n', config: config);
    stdout.writeln(result.language);
    stdout.writeln(result.structure);
    stdout.writeln(result.structure[0].kind);
    stdout.writeln(result.imports);
    stdout.writeln(result.metrics.totalLines);
    stdout.writeln(result.metrics.errorCount);
  } finally {
    RustLib.dispose();
  }
}

Features #

  • 371 languages — pre-compiled tree-sitter grammars covering every major programming language and many minor ones.
  • On-demand download + cache — parsers fetched at first use; subsequent runs hit the local cache.
  • Code intelligence — extract functions, classes, imports, exports, symbols, docstrings, and diagnostics with one API.
  • Syntax-aware chunking — semantic chunks for RAG/LLM pipelines.
  • Polyglot bindings — native APIs across 15 languages: Rust, Python, TypeScript/Node.js, Go, Java, C#, Ruby, PHP, Elixir, WebAssembly, Dart, Kotlin, Swift, Zig, and C/C++ via alef.

Documentation #

Part of Xberg #

  • Xberg — document intelligence: text, tables, metadata from 101 formats with optional OCR.
  • Xberg Enterprise — managed extraction API with SDKs, dashboards, and observability.
  • crawlberg — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
  • html-to-markdown — fast, lossless HTML→Markdown engine.
  • liter-llm — universal LLM API client with native bindings for 14 languages and 165 providers.
  • alef — the polyglot binding generator that produces this README and all per-language bindings.
  • Discord — community, roadmap, announcements.

Contributing #

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Join our Discord community for questions and discussion.

License #

MIT -- see LICENSE for details.

0
likes
155
points
1.07k
downloads

Documentation

API reference

Publisher

verified publisherxberg.io

Weekly Downloads

Pre-compiled tree-sitter grammars for 371 programming languages

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

crypto, flutter_rust_bridge, freezed_annotation, http, json_annotation

More

Packages that depend on tree_sitter_language_pack