tree-sitter-language-pack.cr

Crystal shard for tree-sitter-language-pack — FFI bindings via alef

tree-sitter-language-pack.cr

Crystal bindings for tree-sitter-language-pack (180+ tree-sitter grammars + code-intelligence), generated by alef. The native libts_pack_core_ffi is downloaded from the upstream GitHub release (Go-style download_ffi), since Crystal has no registry for prebuilt native shards.

Install

dependencies:
  tree_sitter_language_pack:
    github: dsisnero/tree-sitter-language-pack.cr
shards install
./scripts/download_ffi.sh   # fetches libts_pack_core_ffi.so/.dylib/.dll

Usage

crystal build --link-flags="-L.lib -Wl,-rpath,$(pwd)/.lib" src/app.cr
require "tree_sitter_language_pack"

lang = TreeSitterLanguagePack.detect_language_from_extension("rb") # => "ruby"

Test

make spec

Set TSLP_FFI_VERSION / TSLP_FFI_REPO to override the source.

Repository

tree-sitter-language-pack.cr

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • about 2 hours ago
  • August 9, 2026
License

Links
Synced at

Sun, 09 Aug 2026 02:11:58 GMT

Languages