diff options
author | Riley Bruins <ribru17@hotmail.com> | 2025-01-30 13:34:46 -0800 |
---|---|---|
committer | Christian Clason <ch.clason+github@icloud.com> | 2025-02-01 17:02:52 +0100 |
commit | 096ae3bfd7075dce69c70182ccedcd6d33e66d31 (patch) | |
tree | c606ef585a427d4010ea507fb44a7a269f6f95e4 /test/functional/treesitter/parser_spec.lua | |
parent | f3381a8b64befece6055f1993b7bff029f281e02 (diff) | |
download | rneovim-096ae3bfd7075dce69c70182ccedcd6d33e66d31.tar.gz rneovim-096ae3bfd7075dce69c70182ccedcd6d33e66d31.tar.bz2 rneovim-096ae3bfd7075dce69c70182ccedcd6d33e66d31.zip |
fix(treesitter): nil access when running string parser async
Diffstat (limited to 'test/functional/treesitter/parser_spec.lua')
-rw-r--r-- | test/functional/treesitter/parser_spec.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/treesitter/parser_spec.lua b/test/functional/treesitter/parser_spec.lua index 825c2b8f29..a6d3a340f7 100644 --- a/test/functional/treesitter/parser_spec.lua +++ b/test/functional/treesitter/parser_spec.lua @@ -504,6 +504,15 @@ end]] eq({ 0, 0, 0, 13 }, ret) end) + it('can run async parses with string parsers', function() + local ret = exec_lua(function() + local parser = vim.treesitter.get_string_parser('int foo = 42;', 'c') + return { parser:parse(nil, function() end)[1]:root():range() } + end) + + eq({ 0, 0, 0, 13 }, ret) + end) + it('allows to run queries with string parsers', function() local txt = [[ int foo = 42; |