LSP-typescript icon indicating copy to clipboard operation
LSP-typescript copied to clipboard

Show Full Function Definition in Pop Up

Open 9b528120 opened this issue 11 months ago • 3 comments

Maybe I'm using this LSP wrong, but the pop-up when hovering only shows the name and return type of the function, I want to see the full definition without having to jump to that line in the code (because jumping back is annoying)

I don't mean documentation peek, I want a literal text copy of the definition in a mini-window I can scroll within. If there's a plugin that does that (in a sidebar or something), please let me know!

9b528120 avatar Feb 04 '25 17:02 9b528120

The closest to that you can get is by opening definition/declaration in a side-by-side view. That functionality is not bound to any key but you can find it commented out in default LSP key bindings.

rchl avatar Feb 04 '25 17:02 rchl

@rchl I found the binding, but I'd much rather the side-by-side be top/bottom instead of left/right, is that possible?

{
        "keys": ["f1"],
        "command": "lsp_symbol_definition",
        "args": {"side_by_side": true, "force_group": true, "fallback": false, "group": -1},
        "context": [
            {"key": "lsp.session_with_capability", "operand": "definitionProvider"},
            {"key": "auto_complete_visible", "operand": false}
        ]
}

9b528120 avatar Feb 04 '25 18:02 9b528120

I'd much rather the side-by-side be top/bottom instead of left/right, is that possible?

@9b528120 no, not possible

predragnikolic avatar Feb 15 '25 20:02 predragnikolic

Closing since this is not in scope. This could be a feature request to the LSP repo itself but I don't see this happening anytime soon with the current ST API.

rchl avatar Nov 20 '25 19:11 rchl