LSP
LSP copied to clipboard
Update default keybindings
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.
How about listening to goto_definition
instead https://github.com/sublimelsp/LSP/issues/1093
Would that not end up with an infinite loop if we would want to fall-back to the original goto_definition
?
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.
But honestly, there should really exist an EventListener.on_query_definitions (async of course)
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".