Skip to content
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

bug: Treesitter error with nvim-cmp docs #962

Closed
4 tasks done
dpetka2001 opened this issue Oct 2, 2024 · 6 comments · Fixed by #963
Closed
4 tasks done

bug: Treesitter error with nvim-cmp docs #962

dpetka2001 opened this issue Oct 2, 2024 · 6 comments · Fixed by #963
Labels
bug Something isn't working

Comments

@dpetka2001
Copy link

Did you check docs and existing issues?

  • I have read all the noice.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of noice.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.11.0-dev-881+g865ba42e0

Operating system/version

Linux Mint 21.3

Describe the bug

When auto-completing in Python files and the nvim-cmp completion menu pops up, when traversing through the available entries the following error pops up

Error  07:17:11 PM msg_show.lua_error Error executing vim.schedule lua callback: ...y/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:111: No parser for language "text"
stack traceback:
	[C]: in function 'assert'
	...y/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:111: in function 'new'
	.../.repro/plugins/noice.nvim/lua/noice/text/treesitter.lua:39: in function 'highlight'
	....00.1x/.repro/plugins/noice.nvim/lua/noice/text/init.lua:68: in function 'highlight'
	...Tx 6.00.1x/.repro/plugins/nui.nvim/lua/nui/line/init.lua:58: in function 'highlight'
	...Tx 6.00.1x/.repro/plugins/nui.nvim/lua/nui/line/init.lua:73: in function 'render'
	...00.1x/.repro/plugins/noice.nvim/lua/noice/text/block.lua:98: in function 'render'
	....1x/.repro/plugins/noice.nvim/lua/noice/lsp/override.lua:52: in function 'stylize_markdown'
	...00.1x/.repro/plugins/nvim-cmp/lua/cmp/view/docs_view.lua:64: in function 'open'
	...on/MITx 6.00.1x/.repro/plugins/nvim-cmp/lua/cmp/view.lua:299: in function 'callback'
	... 6.00.1x/.repro/plugins/nvim-cmp/lua/cmp/utils/async.lua:138: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

I don't see this error in Lua files and since I don't do anything else except Python and Lua, I'm not sure if this also occurs with other languages as well.

Steps To Reproduce

I'm using LazyVim distro but was also able to reproduce this without LazyVim with this minimal repro.

  1. Open a Python file
  2. Start typing print and go through the available entries
  3. The error should pop up

Expected Behavior

No error should pop up. I'm guessing this has something to do with the latest Treesitter changes on Neovim nightly, because it's not reproducible with Neovim stable 0.10.1.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/noice.nvim", opts = {} },
    -- add any other plugins here
  },
})
@dpetka2001 dpetka2001 added the bug Something isn't working label Oct 2, 2024
@dpetka2001 dpetka2001 changed the title bug: Treesitter bug with nvim-cmp docs bug: Treesitter error with nvim-cmp docs Oct 2, 2024
@dpetka2001
Copy link
Author

If you comment out the line ["vim.lsp.util.stylize_markdown"] = true, then the error does not trigger.

@folke
Copy link
Owner

folke commented Oct 2, 2024

I think I know what's causing this. There's an upstream recent change where get_parser no longer errors when no parser is available and returns nil instead. Will look into it tomorrow. not home right now

@dpetka2001
Copy link
Author

No problem. Thanks a lot 😄

@folke
Copy link
Owner

folke commented Oct 2, 2024

Caused by neovim/neovim#30379

@folke folke closed this as completed in 5070aae Oct 2, 2024
@folke
Copy link
Owner

folke commented Oct 2, 2024

Should be fixed now. Let me know if the problem would persist

folke pushed a commit that referenced this issue Oct 2, 2024
🤖 I have created a release *beep* *boop*
---


## [4.5.2](v4.5.1...v4.5.2)
(2024-10-02)


### Bug Fixes

* **treesitter:** upstream API changes. Fixes
[#962](#962)
([5070aae](5070aae))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@dpetka2001
Copy link
Author

All good now. If I find something else over the next couple of days I'll comment here.

Tnx again 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants