Skip to content
This repository was archived by the owner on Jan 3, 2024. It is now read-only.

Add hoverRange capability #44

Merged
merged 1 commit into from
Aug 15, 2021
Merged

Add hoverRange capability #44

merged 1 commit into from
Aug 15, 2021

Conversation

SamClercky
Copy link
Contributor

Hi,

The latest release of rust-analyzer added the ability to view the type of selected code in visual mode while hovering.

I really wanted that to be enabled in neovim and hacked something together 😄 .

I added a new command RustHoverRange and an experimental capability which will do the work of making the request. It uses the default hover handler for better integration with the hover actions.

I added the new command to the documentation, but did not make a gif of how it works (didn't know how 😢 )

Here some extra links:

Hope you like it! 👍

@simrat39
Copy link
Owner

Sorry for the late response and thanks for the PR! I'll check it out later

@simrat39 simrat39 merged commit c5f8e2d into simrat39:master Aug 15, 2021
@Artturin
Copy link

Artturin commented Feb 6, 2022

Hello, how to use this?

i have this keybinding

    buf_set_keymap("v", "<C-space>", "<cmd>RustHoverRange<CR>", opts)

and when i select something and press control space a error pops up

Error executing vim.schedule lua callback: ...ker/start/rust-tools.nvim/lua/rust-tools/utils/utils.lua:99: attempt to call upva
lue 'fn' (a nil value)
stack traceback:
        ...ker/start/rust-tools.nvim/lua/rust-tools/utils/utils.lua:99: in function 'handler'
        ...eovim-unwrapped-0.6.1/share/nvim/runtime/lua/vim/lsp.lua:964: in function 'cb'
        vim.lua:285: in function <vim.lua:285>

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

Successfully merging this pull request may close these issues.

3 participants