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

Symbol’s function definition is void: treemacs-define-leaf-node #84

Open eamonnsullivan opened 2 years ago

eamonnsullivan commented 2 years ago

Describe the bug I use straight.el on emacs 28.2, so I'm running the latest master version of metals. I'm getting the following error on start up of emacs:

Error (use-package): lsp-metals/:catch: Symbol’s function definition is void: treemacs-define-leaf-node

And a similar error when metals tries to start (when I open a Scala file):

Error running timer: (void-function treemacs-define-leaf-node)

This might be related to #81, because I see the following error just before: Eager macro-expansion failure: (wrong-number-of-arguments (1 . 1) 0)

To Reproduce I will attempt to come up with a simple series of steps, but my configuration and, specifically, the lsp start up module is here.

I get the same error on emacs start if I strip absolutely everything else from my init-lsp.el except:

(use-package lsp-metals)

With that configuration, I just have to start emacs or try to start metals on any scala file to reproduce.

Expected behavior lsp-metals to compile and start.

eamonnsullivan commented 2 years ago

The issue goes away if I roll back treemacs to commit 76807be. So what I think might be happening is that lsp-metals is using a symbol that has been removed, just in the last couple of days.

This suits as a workaround -- I'll just pin treemacs to an older commit. But it might be a good heads up for the next release.

eamonnsullivan commented 2 years ago

Probably related issue on treemacs here.

eamonnsullivan commented 2 years ago

Final note on this, it looks like treemacs-define-leaf-node-type is the intended replacement for this obsolete macro, but the arguments are different enough that I couldn't come up with a patch without knowing a lot more about how this is being used.

jcazevedo commented 2 years ago

The old API is there, just not loaded by default. Requiring treemacs-extensions explicitly seems to fix this for the time being. I opened #85 proposing that.

peterbecich commented 2 years ago

Could we do what this comment describes to solve this? https://github.com/emacs-lsp/lsp-metals/blob/6af70181699c5470be34940ee16b44374cec2037/lsp-metals-treeview.el#L651-L661

peterbecich commented 2 years ago

Thanks @jcazevedo , I have solved it temporarily by adding

(require 'treemacs-extensions)

to init.el

Kazark commented 2 years ago

I got bit by this too.

PRESFIL commented 2 years ago

85 merged.

erickisos commented 1 year ago

I recently did a fresh install of doomemacs again but realized that I was facing this issue. I am not sure if it's just related to scala/metals, maybe I can do a quick search on all the lsp/extensions of doom-emacs to know which ones are working with this deprecated API.

Just came here to know what do you think? Should we check if there are any other plugins being affected?