emacs-lsp / lsp-metals

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

metals-treeview weird behaviour #4

Open kpbochenek opened 4 years ago

kpbochenek commented 4 years ago

Hi,

I am opening scala project -> M-x lsp-metals-treeview , I can correctly see 3 sections with Packages, Compile and Build.

But clicking on anything doesn't work. In Packages I have to press TAB to expand, can I configure it? In Build pressing TAB results in [Treemacs Failure] No TAB action defined for node of type treemacs-metals-leaf-state

I use raw emacs and include lsp-mode, lsp-treemacs and lsp-metals in my config(+evil).

Maybe it is just configuration, in that case could you describe how to configure it properly? I could also add that to (https://scalameta.org/metals/docs/editors/emacs.html) for others.

dsyzling commented 4 years ago

Hi @kpbochenek apologies for the issues, I think I need to review the metals treemacs implementation. Since writing this a new version of treemacs has been released with quite a few implementation changes internally and I believe this is causing node selection issues. Originally I had to work around some limitations in treemacs and may be this code is now causing issues.

So I really don't think it's your config.

I'll try and grab some time to review the code and work through the issues.

kurnevsky commented 4 years ago

It doesn't work well for me either, like sudden disappearings. I'd like to make it simpler but need to align our vision with @dsyzling first.

In Packages I have to press TAB to expand, can I configure it?

I think it should be configurable on treemacs level.

In Build pressing TAB results in [Treemacs Failure] No TAB action defined for node of type treemacs-metals-leaf-state

This is an expected behavior. When I presses TAB I don't expect some action to be executed, I usually just want a node to be expanded. And an action is bound to RET.

yyoncho commented 4 years ago

As a side note, I have created a wrapper for treemacs in lsp-treemacs,lsp-treemacs-render which accepts plain datastructures and generally results in less and easier to understand code.