LSP icon indicating copy to clipboard operation
LSP copied to clipboard

Update default keybindings

Open kiwec opened this issue 3 years ago • 5 comments

F12 isn't bound by default for "goto definition", which isn't the behavior I expected after installing this. I expected it to override the default keybinding, since it always falls back to sublime's "goto definition" when it doesn't find anything.

Since you can ctrl+click anything in ST4 to open it in a split tab (side_by_side: true), there should be a default keybinding for that, too.

kiwec avatar May 21 '21 10:05 kiwec

How about listening to goto_definition instead https://github.com/sublimelsp/LSP/issues/1093

rwols avatar May 28 '21 20:05 rwols

Would that not end up with an infinite loop if we would want to fall-back to the original goto_definition?

rchl avatar May 29 '21 09:05 rchl

If it turns out that the langserver has no definitions to provide, we can run a special command, say, lsp_fallback_goto_definition. It does nothing. A command listener can then listen for that command and rewrite it to goto_definition.

The command listener that listens for goto_definition is skipped, because commands can be rewritten at most once.

rwols avatar May 31 '21 18:05 rwols

But honestly, there should really exist an EventListener.on_query_definitions (async of course)

rwols avatar May 31 '21 18:05 rwols

Can I just advocate that when there is automatic fallback behaviour (e.g. lsp_symbol_definition -> goto_definition), that it's at least made possible to disable that?

Because otherwise, as a (power?) user, when we get a definition that we didn't expect, we have to start second-guessing whether it gave a "smart" result (LSP) or "dumb" result (Syntax-based). It's valuable to leave the possibility to write a custom keybinding that gives "smart result or nothing".

frou avatar Jun 02 '21 13:06 frou