tree-sitter-language-pack

repository·main·Indexed 19 days ago

https://github.com/xberg-io/tree-sitter-language-pack

A high-performance distribution of 371 pre-compiled Tree-sitter grammars. It provides a unified catalog for parsing multiple languages without manual compilation, featuring on-demand downloading, a shared cache model, and code intelligence primitives for extracting symbols, docstrings, and syntax-aware chunks for RAG and LLM pipelines. Available via C/C++ FFI, Node.js (NAPI), WebAssembly, and a CLI tool (ts-pack-cli) with MCP server support.

Tokens
228.3K
Snippets
697
Records
994
Agent score
56%

What's inside tree-sitter-language-pack

  1. Overview of Swift bindings for tree-sitter-language-pack

    main

    This package provides Swift bindings for tree-sitter-language-pack, offering access to 371 pre-compiled tree-sitter grammars. It is built via swift-bridge and supports macOS, iOS, and Linux. The package provides native Swift types and supports async/await patterns.

    Key Capabilities

    • Parser access: Load any tree-sitter language parser by name without manually wiring individual grammar crates or packages.
    • Code intelligence primitives: Extract parse trees, functions, classes, imports, exports, symbols, docstrings, diagnostics, and syntax-aware chunks.
    • Shared cache model: Parsers are fetched and cached once upon first use and reused throughout the process.
    • Syntax-aware chunking: Provides semantic chunks specifically designed for RAG (Retrieval-Augmented Generation) and LLM pipelines.
    • Unified catalog: Uses the same grammar set as all other language bindings (Rust, Python, Node.js, etc.).
  2. Overview of Zig bindings for tree-sitter-language-pack

    main

    This package provides Zig bindings for tree-sitter-language-pack, offering access to 371 pre-compiled tree-sitter grammars. It is designed for high-performance code intelligence tasks in Zig, utilizing direct C FFI via @cImport, idiomatic error sets, optional types, and slice-based memory management.

    Key capabilities include:

    • Parser access: Load any tree-sitter language parser by name without manually wiring individual grammar crates.
    • Code intelligence primitives: Extract parse trees, functions, classes, imports, exports, symbols, docstrings, diagnostics, and syntax-aware chunks.
    • Shared cache model: Parsers are fetched and cached once upon first use and reused throughout the process.
    • Unified catalog: Uses the same grammar set as all other language bindings (Rust, Python, Node.js, etc.).
  3. Overview of Kotlin (Android) bindings for tree-sitter-language-pack

    main

    The tree-sitter-language-pack-android package provides Android AAR bindings for the tree-sitter-language-pack. It includes 371 pre-compiled tree-sitter grammars and is designed for mobile parser workloads.

    Key Capabilities

    • Parser Access: Load a tree-sitter language parser by name without manually wiring individual grammar packages.
    • Code Intelligence: Extract high-level primitives including parse trees, functions, classes, imports, exports, symbols, docstrings, diagnostics, and syntax-aware chunks.
    • Shared Cache Model: Parsers are fetched and cached once per process and reused for subsequent calls.
    • JNI-based Architecture: Uses JNI with bundled per-ABI native libraries and provides a coroutine-friendly Kotlin facade.

    Note for JVM users: If you are targeting the JVM rather than Android, you should use the canonical Java artifact io.xberg.treesitterlanguagepack:tree-sitter-language-pack instead of this Android-specific package.

  4. Overview of tree-sitter-language-pack features

    main

    The tree-sitter-language-pack provides a unified way to access tree-sitter grammars across multiple languages. Key capabilities include:

    • Parser access: Load any of the 371 supported language parsers by name without managing individual grammar crates or packages.
    • Code intelligence primitives: Built-in support for extracting functions, classes, imports, exports, symbols, docstrings, and diagnostics.
    • Syntax-aware chunking: Semantic chunking capabilities designed for RAG (Retrieval-Augmented Generation) and LLM pipelines.
    • Shared cache model: Parsers are fetched and cached once per process and reused across calls.
    • Polyglot support: The same grammar catalog is available via native bindings for Rust, Python, Node.js, Go, Java, C#, Ruby, PHP, Elixir, WASM, Dart, Kotlin, Swift, Zig, and C FFI.
  5. Overview of PlantUML Tree-Sitter Grammar Components

    main

    The PlantUML grammar is divided into specific modules that handle different aspects of the UML syntax. This modularity allows for organized storage of grammar rules and type definitions.

    • base.js: Contains the base grammar rules and the fundamental UML types.
    • class.js: Specifically handles the logic and rules for class declarations within PlantUML.
  6. Overview of tree-sitter-language-pack

    main
    The tree-sitter-language-pack is a comprehensive library designed to allow developers to parse and understand source code in 371 different languages. It eliminates the need to manually manage or compile individual Tree-sitter grammars by providing a single dependency that bundles them all. It is available across a wide range of programming languages and runtimes, including Rust, Python, Node.js, WASM, Java, Go, C#, PHP, Ruby, Elixir, Dart, Kotlin, Swift, and Zig, as well as via C FFI.
  7. Overview of Dart / Flutter bindings for tree-sitter-language-pack

    main

    The tree_sitter_language_pack package for Dart and Flutter provides access to 371 pre-compiled tree-sitter grammars. It is built using flutter_rust_bridge, which enables isolate-safe Future APIs and provides Flutter-native type mapping.

    Key Capabilities

    • Parser Access: Load any tree-sitter language parser by name without manually managing individual grammar crates or packages.
    • Code Intelligence: Extract high-level primitives including parse trees, functions, classes, imports, exports, symbols, docstrings, diagnostics, and syntax-aware chunks.
    • Shared Cache Model: Parsers are fetched and cached upon first use and reused across all subsequent calls in the process.
    • RAG/LLM Support: Provides syntax-aware semantic chunking specifically designed for RAG (Retrieval-Augmented Generation) and LLM pipelines.
    • Consistency: Uses the same grammar catalog as all other language bindings (Rust, Python, Node.js, Go, etc.).
  8. What tree_sitter_language_pack provides for Elixir

    main

    The Elixir binding for tree-sitter-language-pack provides several core capabilities for code analysis:

    • Parser access: Load a tree-sitter language parser by name without manually wiring individual grammar crates.
    • Code intelligence primitives: Extract parse trees, functions, classes, imports, exports, symbols, docstrings, diagnostics, and syntax-aware chunks.
    • Shared cache model: Parsers are fetched and cached once upon first use and reused throughout the process.
    • Syntax-aware chunking: Semantic chunking capabilities specifically designed for RAG (Retrieval-Augmented Generation) and LLM pipelines.
    • Polyglot consistency: Access to the same catalog of 371 languages used across all other language bindings (Rust, Python, Node.js, etc.).
  9. What @xberg-io/tree-sitter-language-pack-wasm provides

    main

    The WebAssembly package provides a high-performance, browser-compatible way to access tree-sitter grammars with the following capabilities:

    • Parser access: Load any language parser by name without manually managing individual grammar crates.
    • Code intelligence primitives: Built-in support for extracting parse trees, functions, classes, imports, exports, symbols, docstrings, diagnostics, and syntax-aware chunks.
    • Shared cache model: Parsers are fetched and cached once per process to optimize performance.
    • Unified catalog: Access to the same 371+ languages available in the native bindings (Rust, Python, Node.js, etc.).
    • RAG/LLM support: Includes syntax-aware chunking for semantic code splitting in LLM pipelines.
  10. Key features of tree-sitter-language-pack

    main

    The tree-sitter-language-pack provides high-performance code intelligence for 371 languages. Key capabilities include:

    • Zero-config parsing: One installation covers hundreds of languages without needing to manually compile or fetch grammars.
    • On-demand parser downloading: The base install is small; individual parsers are fetched and cached only when the specific language is used.
    • Code Intelligence: Beyond raw syntax trees, you can extract functions, classes, imports, exports, symbols, comments, and docstrings with single API calls.
    • LLM-ready Chunking: Split source code at semantic boundaries (functions, classes, blocks) to ensure chunks remain intact for embeddings and prompt windows.
    • Native Language Interop: The get_language() method returns your ecosystem's native Language object (e.g., in Python, Node.js, Go, etc.), allowing seamless integration with existing tree-sitter parsers.