-
Notifications
You must be signed in to change notification settings - Fork 109
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 markdown highlight #378
Labels
bug
Something isn't working
Comments
also noticed the signature help thing before |
folke
added a commit
that referenced
this issue
Mar 3, 2023
willothy
pushed a commit
to willothy/noice.nvim
that referenced
this issue
Aug 19, 2023
willothy
pushed a commit
to willothy/noice.nvim
that referenced
this issue
Aug 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.9.0-dev-1023+g649742821
Operating system/version
MacOS Ventura 13.1
Describe the bug
Bug:
After the new PR by lewis with
vim.treesitter.language.add()
(Not sure if this was the case before that), this line here may break highlighting in the buffer:noice.nvim/lua/noice/text/init.lua
Line 66 in f148923
Screen.Recording.2023-03-03.at.17.45.40.mov
There are two reasons for this I believe. The first one is that it uses the filetype to check for a parser when the argument should really be the parsername. For example in this case, when I backspace and get a signature help it will call that function with
typescriptreact
, and that is not the parser name. I think it ideally should usevim.treesitter.language.get_lang
which would give the correct parsernametsx
.The other reason is probably that I am not sure
vim.treesitter.language.require_language
is the correct way to check if a parser is available. I think it ideally should use something likehas_parser
either from upstream or nvim-treesitter (would then need to add it as a required dependency which is not the best even though there are probably a minority who are not using it).Follow up question while I am here
While I am at it, I also noticed that the language server from rust for example returns a code block without specifying the language only when sending signature results. On hover it does it correctly. I am not sure if this applies to others as well. This will make the hover look like this:
While signature looks like this:
This is because of the fallback to
text
here:noice.nvim/lua/noice/text/markdown.lua
Line 88 in f148923
Would it make sense to fallback to the filetype here instead maybe?
Steps To Reproduce
Sorry for not being able to have an easier replication of the bug.
npm install
App.tsx
and do as I did in the videoExpected Behavior
It would not remove treesitter highlighting from the buffer when doing
:e
Repro
The text was updated successfully, but these errors were encountered: