emacs-lsp / lsp-metals

lsp-mode :heart: metals
https://emacs-lsp.github.io/lsp-metals
GNU General Public License v3.0
58 stars 34 forks source link

lsp-metals treeview interferes with commands when refreshing #16

Open julianmichael opened 4 years ago

julianmichael commented 4 years ago

[Edited for clarity after further testing]

Describe the bug While code is compiling and the lsp-metals treeview is refreshing with compile progress for the modules in a project, it messes with the ability to execute commands: for example, if I do a /-search (I'm in evil mode), if a refresh happens while I'm typing the query, it might shunt me into insert mode or suddenly delete the whole buffer. After this happens, commands don't work properly either, e.g., d (again in Evil normal mode) immediately deletes a whole line as if I executed dd. This may have to do with interactions with Evil mode but I'm not sure. It's hard for me to tell what the underlying problem is because it seems unpredictable. But altogether the this prevents me from doing basically anything while code is compiling.

To Reproduce Open a scala project which takes a non-trivial amount of time to compile. Edit and save a file to trigger a compile. Then try inserting some text, executing a search within file, etc.—each refresh messes things up.

In case it matters, I'm using Spacemacs (develop) in Evil mode. So that might affect something related to the cursor movement. Idk.

Expected behavior I expect the treeview buffer to refresh itself silently, without interfering with commands or getting the editor into weird states.

kurnevsky commented 4 years ago

Just to clarify - it happens when your main file buffer is focused and you are editing it, right? I didn't see such problem...

Maybe @dsyzling will have an idea.

dsyzling commented 4 years ago

Sorry distracted with work at the moment. Since the internals of treemacs has changed and is causing issues with the metals-treeview implementation, I'm going to have try and recreate these issues once I've re-implemented on the new treemacs api. I'll also reassess some of the implementation decisions.

julianmichael commented 4 years ago

@kurnevsky yes, that's right. As in #14, I've worked around it for now by just not using the treemacs view. Since @dsyzling is already planning changes there, we can just wait and I can update and report back after those.

For the record, I'm on emacs 26.3, Spacemacs develop (c6634203), and my .spacemacs file is here.