aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/treesitter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/lua/treesitter.c')
-rw-r--r--src/nvim/lua/treesitter.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c
index 44e743e911..33d9772bec 100644
--- a/src/nvim/lua/treesitter.c
+++ b/src/nvim/lua/treesitter.c
@@ -174,6 +174,14 @@ int tslua_add_language(lua_State *L)
return luaL_error(L, "Failed to load parser: internal error");
}
+ uint32_t lang_version = ts_language_version(lang);
+ if (lang_version < TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION) {
+ return luaL_error(
+ L,
+ "ABI version mismatch : expected %" PRIu32 ", found %" PRIu32,
+ TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION, lang_version);
+ }
+
pmap_put(cstr_t)(langs, xstrdup(lang_name), lang);
lua_pushboolean(L, true);