fix lsp_check_applicable starting extra server instance#2893
fix lsp_check_applicable starting extra server instance#2893
Conversation
To be honest, this is exactly what I intended to do when I implemented this command. So It's not clear from looking at the code why I think the best would be to refactor Or maybe we could even move the logic from here into a new higher level function |
|
I'm not sure I really want to do big refactorings here but I've now checked and that fix doesn't really work (at least for re-enabling previously disabled view) so need to do some change for sure. I guess it's missing explicit |
|
I've moved the logic to if listener == self._new_listener:
debug(f'Already starting relevant sessions for view {view}.')
returnAside from that I've chosen to ignore the |
|
After seeing how this command is used in LSP-copilot (unconditionally in Maybe we could add a |
|
I kinda thought that maybe it would be OK to just run this code on view activation. It shouldn't be that expensive and in most cases it would do nothing. |
Then we could better move that functionality into LSP directly, instead of providing the command, to ensure that the checks are only triggered one time per view activation. But I'd rather keep it as a command and only do the check on demand. My intention when implementing the command was that LSP-copilot would use a file watcher for |
Fix issue noticed in sublimelsp/LSP-copilot#279
The
LspCheckApplicableCommandwas triggeringwm.start_asyncwhile there was session being started already, causing it to be started twice. It requires certain timing that for me only seemed to trigger on linux.Use the existing session-starting machinery instead of short-cutting some of its internal logic that historically caused us issues.