diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-04-19 16:04:57 +0100 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-08-26 16:44:03 +0200 |
commit | 688b961d13bd54a14836f08c3ded3121d3fb15a0 (patch) | |
tree | b201413b8616abc42283545b146fb1492d56b861 /test/functional/treesitter/language_spec.lua | |
parent | 664de5ea971440f24e3e7e3618786d01fbca6025 (diff) | |
download | rneovim-688b961d13bd54a14836f08c3ded3121d3fb15a0.tar.gz rneovim-688b961d13bd54a14836f08c3ded3121d3fb15a0.tar.bz2 rneovim-688b961d13bd54a14836f08c3ded3121d3fb15a0.zip |
feat(treesitter): add support for wasm parsers
Problem: Installing treesitter parser is hard (harder than
climbing to heaven).
Solution: Add optional support for wasm parsers with `wasmtime`.
Notes:
* Needs to be enabled by setting `ENABLE_WASMTIME` for tree-sitter and
Neovim. Build with
`make CMAKE_EXTRA_FLAGS=-DENABLE_WASMTIME=ON
DEPS_CMAKE_FLAGS=-DENABLE_WASMTIME=ON`
* Adds optional Rust (obviously) and C11 dependencies.
* Wasmtime comes with a lot of features that can negatively affect
Neovim performance due to library and symbol table size. Make sure to
build with minimal features and full LTO.
* To reduce re-compilation times, install `sccache` and build with
`RUSTC_WRAPPER=<path/to/sccache> make ...`
Diffstat (limited to 'test/functional/treesitter/language_spec.lua')
-rw-r--r-- | test/functional/treesitter/language_spec.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/functional/treesitter/language_spec.lua b/test/functional/treesitter/language_spec.lua index ba2d2218e3..6c211049f0 100644 --- a/test/functional/treesitter/language_spec.lua +++ b/test/functional/treesitter/language_spec.lua @@ -57,8 +57,12 @@ describe('treesitter language API', function() local keys, fields, symbols = unpack(exec_lua(function() local lang = vim.treesitter.language.inspect('c') local keys, symbols = {}, {} - for k, _ in pairs(lang) do - keys[k] = true + for k, v in pairs(lang) do + if type(v) == 'boolean' then + keys[k] = v + else + keys[k] = true + end end -- symbols array can have "holes" and is thus not a valid msgpack array @@ -69,7 +73,7 @@ describe('treesitter language API', function() return { keys, lang.fields, symbols } end)) - eq({ fields = true, symbols = true, _abi_version = true }, keys) + eq({ fields = true, symbols = true, _abi_version = true, _wasm = false }, keys) local fset = {} for _, f in pairs(fields) do |