Ruin0x11 / lsp-intellij

Emacs client for lsp-intellij-server
GNU General Public License v3.0
57 stars 11 forks source link

Provide/Document a way to recover failures #6

Open iocanel opened 6 years ago

iocanel commented 6 years ago

Every now and then the client communication with the server breaks. It would be nice if there was a way to recover from this situation (currently I have to restart both emacs and intellij to get it back on track).

If such a way exists, then we need to make sure that its well documented.

Ruin0x11 commented 6 years ago

There were at certain points places where certain operations in IntelliJ would block the server from responding to requests. A common example of this is popups for resolving differences in memory/disk versions of a file. But there are probably still more subtle cases where the code can deadlock in non-obvious ways.

For recovering emacs, I do recall there being issues with lsp-mode being unable to restart its workspace if the connection becomes blocked, requiring restarting the process. I remember https://github.com/emacs-lsp/lsp-mode/pull/337 fixing it for a time, but sometime after it stopped working for some reason.

Fixing the IntelliJ plugin is more difficult since there could be various causes. But I think it would be nice if all server connections could be restarted without having to restart IntelliJ as a fallback for now.

iocanel commented 6 years ago

@Ruin0x11 Speaking about theFile Cache Confict dialog, do u know of anyway to stop it from popping up? It really kills the experience.

iocanel commented 6 years ago

What I am doing right now which is not ideal is, using a script to automatically click on load filesystem changes and then return back to the emacs workspace.

#!/bin/bash                                                                                                                                                                                                                                                                                                                     

# Focus on window titled `File Cache Conflict` and send space                                                                                                                                                                                                                                                                   
xdotool search "File Cache Conflict" windowactivate --sync key --clearmodifiers space                                                                                                                                                                                                                                           
# Send space (it should work with a single space)                                                                                                                                                                                                                                                                               
xdotool key space                                                                                                                                                                                                                                                                                                               
# Return back to my emacs workspace                                                                                                                                                                                                                                                                                             
xdotool key Super_L+2                                                                                                                                                                                                                                                                                                           

For now its invoked via i3 key binding, but maybe its better to create a hook for it and have it completely automated.