lsp-metals icon indicating copy to clipboard operation
lsp-metals copied to clipboard

lsp-metals treeview interferes with commands when refreshing

Open julianmichael opened this issue 4 years ago • 3 comments

[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.

julianmichael avatar Jun 30 '20 18:06 julianmichael

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.

kurnevsky avatar Jul 01 '20 07:07 kurnevsky

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.

dsyzling avatar Jul 01 '20 13:07 dsyzling

@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.

julianmichael avatar Jul 01 '20 18:07 julianmichael