mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
feat(ts): include parser ABI version in checkhealth
This commit is contained in:
parent
86ced59a6a
commit
e8bc3d717e
@ -21,7 +21,9 @@ function M.check_health()
|
|||||||
if not is_loadable then
|
if not is_loadable then
|
||||||
report_error(string.format("Impossible to load parser for %s: %s", parsername, ret))
|
report_error(string.format("Impossible to load parser for %s: %s", parsername, ret))
|
||||||
elseif ret then
|
elseif ret then
|
||||||
report_ok(string.format("Loaded parser for %s", parsername))
|
local lang = ts.language.inspect_language(parsername)
|
||||||
|
report_ok(string.format("Loaded parser for %s: ABI version %d",
|
||||||
|
parsername, lang._abi_version))
|
||||||
else
|
else
|
||||||
report_error(string.format("Unable to load parser for %s", parsername))
|
report_error(string.format("Unable to load parser for %s", parsername))
|
||||||
end
|
end
|
||||||
|
@ -229,6 +229,11 @@ int tslua_inspect_lang(lua_State *L)
|
|||||||
}
|
}
|
||||||
|
|
||||||
lua_setfield(L, -2, "fields"); // [retval]
|
lua_setfield(L, -2, "fields"); // [retval]
|
||||||
|
|
||||||
|
uint32_t lang_version = ts_language_version(lang);
|
||||||
|
lua_pushinteger(L, lang_version); // [retval, version]
|
||||||
|
lua_setfield(L, -2, "_abi_version");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ describe('treesitter API', function()
|
|||||||
return {keys, lang.fields, symbols}
|
return {keys, lang.fields, symbols}
|
||||||
]]))
|
]]))
|
||||||
|
|
||||||
eq({fields=true, symbols=true}, keys)
|
eq({fields=true, symbols=true, _abi_version=true}, keys)
|
||||||
|
|
||||||
local fset = {}
|
local fset = {}
|
||||||
for _,f in pairs(fields) do
|
for _,f in pairs(fields) do
|
||||||
|
Loading…
Reference in New Issue
Block a user