Skip to content

Error: Parser could not be created (treesitter highlight) #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
0xJWLabs opened this issue Oct 18, 2024 · 2 comments
Closed

Error: Parser could not be created (treesitter highlight) #133

0xJWLabs opened this issue Oct 18, 2024 · 2 comments

Comments

@0xJWLabs
Copy link
Contributor

I got this error

vim.schedule lua callback: ...s/nvim-linux64/share/nvim/runtime/lua/vim/treesitter.lua:116: Parser could not be created for buffer 14 and language "typescriptreact"
stack traceback:
	[C]: in function 'error'
	...s/nvim-linux64/share/nvim/runtime/lua/vim/treesitter.lua:116: in function 'get_parser'
	/home/jo/plugins/blink.cmp/lua/blink/cmp/utils.lua:85: in function 'highlight_with_treesitter'
	...lugins/blink.cmp/lua/blink/cmp/windows/documentation.lua:77: in function 'callback'
	.../jo/plugins/blink.cmp/lua/blink/cmp/sources/lib/init.lua:77: in function 'fn'
	...jo/plugins/blink.cmp/lua/blink/cmp/sources/lib/async.lua:86: in function 'cb'
	...jo/plugins/blink.cmp/lua/blink/cmp/sources/lib/async.lua:44: in function 'resolve'
	...plugins/blink.cmp/lua/blink/cmp/sources/lib/provider.lua:91: in function <...plugins/blink.cmp/lua/blink/cmp/sources/lib/provider.lua:91>
@0xJWLabs 0xJWLabs changed the title Parser could not be created (treesitter highlight) Error: Parser could not be created (treesitter highlight) Oct 18, 2024
@0xJWLabs
Copy link
Contributor Author

Since I’m on mobile, I can’t do PR. but the culprit is there

local trees = vim.treesitter.get_parser(bufnr, root_lang)

my current solution right now is to make root_lang = "tsx" if root_lang == "typescriptreact"

@Saghen Saghen closed this as completed in 213fd94 Oct 18, 2024
@fredrikaverpil
Copy link

fredrikaverpil commented Dec 30, 2024

@Saghen I am getting a variant of this crash:

Error executing vim.schedule lua callback: ...ik/.nvim/share/nvim/runtime/lua/vim/treesitter/_fold.lua:72: Parser could not be created for buffer 11 and language "blink-cmp-signature"
stack traceback:
	[C]: in function 'assert'
	...ik/.nvim/share/nvim/runtime/lua/vim/treesitter/_fold.lua:72: in function 'compute_folds_levels'
	...ik/.nvim/share/nvim/runtime/lua/vim/treesitter/_fold.lua:275: in function 'fn'
	...ik/.nvim/share/nvim/runtime/lua/vim/treesitter/_fold.lua:251: in function <...ik/.nvim/share/nvim/runtime/lua/vim/treesitter/_fold.lua:247>

Repro steps:

  1. Set up tree-sitter folding: https://github.com/fredrikaverpil/dotfiles/blob/e1724d3493df4713082c9cc03bf7d3f9f192bafa/nvim-fredrik/lua/fredrik/config/options.lua#L92-L93
  2. In Lua, use snippet: https://github.com/fredrikaverpil/dotfiles/blob/3e24f345714a606714ec9038bdb8b6d4070531ba/nvim-fredrik/snippets/lua.json#L3
  3. Invoke snippet and start typing "foo (and crash is hit).

I'm on Neovim 0.11 nightly and blink.cmp v0.8.2:

NVIM v0.11.0-dev-1427+gd3951be4a0
Build type: RelWithDebInfo
LuaJIT 2.1.1734355927
Run "nvim -V1 -v" for more info

Should I file a formal bug report in the issue tracker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants