add tree-sitter syntax highlighting via dart:ffi

Vendor libtree-sitter.so (v0.26.8, wasmtime 44.0 statically linked)
and call its C API through dart:ffi. Grammar WASM files are loaded by
tree-sitter's embedded wasmtime engine via ts_wasm_store_load_language.

48 grammars compiled with tree-sitter build --wasm, 48 highlight
queries (42 from upstream repos, 6 written in-house for comment,
erlang, gdscript, gitignore, hcl, hlsl, swift). SQLite grammar
replaces full SQL (974K-line parser exhausted RAM at compile time).

Removes wasm_run and wasm_run_flutter — they downloaded a 22 MB
binary from GitHub at first launch, violating the no-network-on-
default-launch-path policy.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-04-22 22:08:00 +02:00
co-authored by Claude
parent 4f5d97ebc5
commit ce8529e424
111 changed files with 7046 additions and 9 deletions
+6
View File
@@ -112,6 +112,12 @@ install(DIRECTORY "${NATIVE_ASSETS_DIR}"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
# Vendored native libraries (libtree-sitter with wasmtime embedded).
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../native/linux-x64/"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime
FILES_MATCHING PATTERN "*.so")
# Fully re-copy the assets directory on each build to avoid having stale files
# from a previous install.
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")