Skip to content

Commit

Permalink
docs(vimdoc): add missing hover and codeAction docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jan 2, 2025
1 parent 362e45b commit dd97717
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/rustaceanvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ It accepts the following subcommands:
`args[]` allows you to override the executable's arguments.
'expandMacro' - Expand macros recursively.
'moveItem {up|down}' - Move items up or down.
'codeAction' - Sometimes, rust-analyzer groups code actions by category,
which is not supported by Neovim's built-in |vim.lsp.buf.codeAction|.
This command provides a command with a UI that does.
If you set the option `vim.g.rustaceanvim.tools.code_actions.ui_select_fallback`
to `true` (defaults to `false`), it will fall back to |vim.ui.select|
if there are no grouped code actions.
'hover {actions|range}' - Hover actions, or hover over visually selected range.
You can invoke a hover action by switching to the hover window and entering `<CR>`
on the respective line, or with a keymap for the `<Plug>RustHoverAction` mapping,
which accepts a `<count>` prefix as the (1-based) index of the hover action to invoke.

For example, if you set the keymap: `vim.keymap.set('n', '<space>a', '<Plug>RustHoverAction')`,
you can invoke the third hover action with `3<space>a`.
'explainError {cycle?|current?}' - Display a hover window with explanations form the Rust error index.
- If called with |cycle| or no args:
Like |vim.diagnostic.goto_next|,
Expand Down
12 changes: 12 additions & 0 deletions lua/rustaceanvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@
--- `args[]` allows you to override the executable's arguments.
--- 'expandMacro' - Expand macros recursively.
--- 'moveItem {up|down}' - Move items up or down.
--- 'codeAction' - Sometimes, rust-analyzer groups code actions by category,
--- which is not supported by Neovim's built-in |vim.lsp.buf.codeAction|.
--- This command provides a command with a UI that does.
--- If you set the option `vim.g.rustaceanvim.tools.code_actions.ui_select_fallback`
--- to `true` (defaults to `false`), it will fall back to |vim.ui.select|
--- if there are no grouped code actions.
--- 'hover {actions|range}' - Hover actions, or hover over visually selected range.
--- You can invoke a hover action by switching to the hover window and entering `<CR>`
--- on the respective line, or with a keymap for the `<Plug>RustHoverAction` mapping,
--- which accepts a `<count>` prefix as the (1-based) index of the hover action to invoke.
---
--- For example, if you set the keymap: `vim.keymap.set('n', '<space>a', '<Plug>RustHoverAction')`,
--- you can invoke the third hover action with `3<space>a`.
--- 'explainError {cycle?|current?}' - Display a hover window with explanations form the Rust error index.
--- - If called with |cycle| or no args:
--- Like |vim.diagnostic.goto_next|,
Expand Down

0 comments on commit dd97717

Please sign in to comment.