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

Treesitter integration on hover actions #20

Closed
NicolasGB opened this issue Oct 23, 2023 · 2 comments · Fixed by #21
Closed

Treesitter integration on hover actions #20

NicolasGB opened this issue Oct 23, 2023 · 2 comments · Fixed by #21
Assignees
Labels
bug Something isn't working

Comments

@NicolasGB
Copy link
Contributor

NicolasGB commented Oct 23, 2023

Neovim version (nvim -v)

v0.9.4

Operating system/version

Archlinux

Output of :checkhealth ferris

Everything prints OK

How to reproduce the issue

First of all thank you for forking rust-tools, your approach to plugins is really nice, hopefully this fork will live long!

I found the repo following the bug where multiple instances of RA were spawned. Thanks for fixing that so fast!

I found a "bug" in the Rust HoverActions, previously on rust-tools, the syntax highlighting with themes and TreeSitter (correct me if I'm wrong) was used. Now when I hover functions the text seems plain and it's not parsed by the theme which uses TS.

Would be nice to maintain that as it's clearer when reading rust-docs.

Let me know if this is intended and there should be flagged as enhancement instead of bug.

Expected behaviour

image

Actual behaviour

image

The minimal config used to reproduce this issue.

Open a rust project and hover a documented function such as tracing_subscriber

@NicolasGB NicolasGB added the bug Something isn't working label Oct 23, 2023
@mrcjkb
Copy link
Owner

mrcjkb commented Oct 23, 2023

Hmm, that's strange - it works on my end (I know that's not a very helpful comment 😄)

Your first screen shot looks like it's Neovim's built-in hover UI (there are no actions).
I did add a new config (that defaults to true):

vim.g.rustaceanvim = {
  tools = {
    hover_actions = {
      replace_builtin_hover = true,
    },
  },
}

I guess if you set that to false, you'll have the old behaviour back.
But I did configure hover actions to use tree-sitter highlighting (they didn't before, iirc).
I do this by setting vim.bo[bufnr].ft = 'markdown'. But I've only tested this with Neovim nightly. Maybe it doesn't work in Neovim 0.9.4?

I'll have to try and reproduce it...

@mrcjkb
Copy link
Owner

mrcjkb commented Oct 23, 2023

Can reproduce with Neovim 0.9.4.

@mrcjkb mrcjkb self-assigned this Oct 23, 2023
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