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

Show treesitter errors as virtual text or virtual lines #13959

Open
teto opened this issue Feb 17, 2021 · 10 comments
Open

Show treesitter errors as virtual text or virtual lines #13959

teto opened this issue Feb 17, 2021 · 10 comments
Labels

Comments

@teto
Copy link
Member

teto commented Feb 17, 2021

  • nvim --version: master
  • Operating system/version: nixos

treesitter is a very exciting development of neovim but it is not quite mature yet and I do end up disabling it more than I would like, mainly because of all the error messages it displays along the text buffer, such as invalid node type at position 1366 (which can appear on almost every line in certain scenario).

As I doubt this kind of warning disappears anytime soon, I wonder if we could somehow reuse the lsp machinery and catch these errors and instead of displaying them rightaway, reexport them as lsp diagnostics ? so one could control how they are displayed ? (as virtual text, error/warnings etc)

cc @vigoux

@teto teto added enhancement feature request treesitter labels Feb 17, 2021
@chentoast

This comment was marked as off-topic.

@theHamsta

This comment was marked as off-topic.

@mcepl

This comment was marked as off-topic.

@TheLostLambda

This comment was marked as off-topic.

@sober-wang

This comment was marked as off-topic.

@RaafatTurki

This comment was marked as off-topic.

@clason clason changed the title invalid node type at position 1366 Show treesitter errors as virtual text or virtual lines Aug 21, 2022
@clason
Copy link
Member

clason commented Aug 21, 2022

Note to others: this issue is not about the actual error (which is a downstream (nvim-treesitter) issue at the moment) but about how Neovim displays such errors.

@clason
Copy link
Member

clason commented Aug 21, 2022

I don't think using diagnostics is the right avenue for this: these are about issues with the actual code, while the error here is an internal Neovim (or plugin, or config) error and should be reported using the standard way for such errors: the message area (so either via vim.notify or emsg, depending on where in the code stack these appear). Any context from the current buffer should be part of the stack trace.

@RaafatTurki

This comment was marked as off-topic.

@clason

This comment was marked as off-topic.

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

No branches or pull requests

8 participants