diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2025-03-01 15:51:09 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-01 15:51:09 +0000 |
| commit | ec8922978eb14fe62671628bb25215743712eac0 (patch) | |
| tree | d47554beaef78ec4f0ca988adc48f3e2336f38c2 /runtime/doc | |
| parent | 48e6147e64b819d2a4130697bb348dcd368a4391 (diff) | |
| download | rneovim-ec8922978eb14fe62671628bb25215743712eac0.tar.gz rneovim-ec8922978eb14fe62671628bb25215743712eac0.tar.bz2 rneovim-ec8922978eb14fe62671628bb25215743712eac0.zip | |
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 <c.clason@uni-graz.at>
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/news.txt | 2 | ||||
| -rw-r--r-- | runtime/doc/treesitter.txt | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 0d47c7adb9..b9c1e55305 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -409,6 +409,8 @@ TREESITTER • |:InspectTree| now shows which nodes are missing. • Bundled markdown highlight queries use `conceal_lines` metadata to conceal code block fence lines vertically. +• |vim.treesitter.language.inspect()| shows additional information, including + parser version for ABI 15 parsers. TUI diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 8c63f0b5db..5916ec9371 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -1192,14 +1192,17 @@ get_lang({filetype}) *vim.treesitter.language.get_lang()* inspect({lang}) *vim.treesitter.language.inspect()* Inspects the provided language. - Inspecting provides some useful information on the language like node and - field names, ABI version, and whether the language came from a WASM - module. + Inspecting provides some useful information on the language like ABI + version, parser state count (a measure of parser complexity), node and + field names, and whether the language came from a WASM module. Node names are returned in a table mapping each node name to a `boolean` indicating whether or not the node is named (i.e., not anonymous). Anonymous nodes are surrounded with double quotes (`"`). + For ABI 15 parsers, also show parser metadata (major, minor, patch + version) and a table of supertypes with their respective subtypes. + Parameters: ~ • {lang} (`string`) Language |