From ec8922978eb14fe62671628bb25215743712eac0 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sat, 1 Mar 2025 15:51:09 +0000 Subject: feat(treesitter): add more metadata to `language.inspect()` (#32657) Problem: No way to check the version of a treesitter parser. Solution: Add version metadata (ABI 15 parsers only) as well as parser state count and supertype information (ABI 15) in `vim.treesitter.language.inspect()`. Also graduate the `abi_version` field, as this is now the official upstream name. --------- Co-authored-by: Christian Clason --- test/functional/treesitter/language_spec.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/functional/treesitter/language_spec.lua b/test/functional/treesitter/language_spec.lua index a93b1063a1..e009d97210 100644 --- a/test/functional/treesitter/language_spec.lua +++ b/test/functional/treesitter/language_spec.lua @@ -63,7 +63,14 @@ describe('treesitter language API', function() return { keys, lang.fields, lang.symbols } end)) - eq({ fields = true, symbols = true, _abi_version = true, _wasm = false }, keys) + eq({ + abi_version = true, + fields = true, + symbols = true, + state_count = true, + supertypes = true, + _wasm = false, + }, keys) local fset = {} for _, f in pairs(fields) do -- cgit