feat: go to hover

_
pull/12208/head
Nik Revenco 2025-04-10 19:13:47 +01:00
parent 0ca5e5472a
commit 90d6a5f652
4 changed files with 5 additions and 5 deletions

View File

@ -290,7 +290,7 @@ This layer is a kludge of mappings, mostly pickers.
| `g` | Open changed file picker | `changed_file_picker` |
| `G` | Debug (experimental) | N/A |
| `k` | Show documentation for item under cursor in a [popup](#popup) (**LSP**) | `hover` |
| `K` | Show documentation for item under cursor in a new buffer (**LSP**) | `hover_dump` |
| `K` | Go to documentation for item under cursor in a new buffer (**LSP**) | `goto_hover` |
| `s` | Open document symbol picker (**LSP**) | `symbol_picker` |
| `S` | Open workspace symbol picker (**LSP**) | `workspace_symbol_picker` |
| `d` | Open document diagnostics picker (**LSP**) | `diagnostics_picker` |

View File

@ -504,7 +504,7 @@ impl MappableCommand {
remove_primary_selection, "Remove primary selection",
completion, "Invoke completion popup",
hover, "Show docs for item under cursor",
hover_dump, "Show docs for item under cursor in a new buffer",
goto_hover, "Show docs for item under cursor in a new buffer",
toggle_comments, "Comment/uncomment selections",
toggle_line_comments, "Line comment/uncomment selections",
toggle_block_comments, "Block comment/uncomment selections",

View File

@ -1078,7 +1078,7 @@ fn hover_impl(cx: &mut Context, hover_action: HoverDisplay) {
}
HoverDisplay::File => {
editor.new_file_from_document(
Action::VerticalSplit,
Action::Replace,
Document::from(
Rope::from(hover.content_string()),
None,
@ -1100,7 +1100,7 @@ pub fn hover(cx: &mut Context) {
hover_impl(cx, HoverDisplay::Popup)
}
pub fn hover_dump(cx: &mut Context) {
pub fn goto_hover(cx: &mut Context) {
hover_impl(cx, HoverDisplay::File)
}

View File

@ -283,7 +283,7 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"R" => replace_selections_with_clipboard,
"/" => global_search,
"k" => hover,
"K" => hover_dump,
"K" => goto_hover,
"r" => rename_symbol,
"h" => select_references_to_symbol_under_cursor,
"c" => toggle_comments,