Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eamonnsullivan opened this issue Oct 26, 2022 · 9 comments
Open

Comments

@eamonnsullivan
Copy link

eamonnsullivan commented Oct 26, 2022

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
Copy link
Author

eamonnsullivan commented Oct 26, 2022

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
Copy link
Author

Probably related issue on treemacs here.

@eamonnsullivan
Copy link
Author

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
Copy link
Contributor

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
Copy link

peterbecich commented Oct 30, 2022

Could we do what this comment describes to solve this?

;;
;; We can possibly remove the leaf node definition and
;; replace lsp-metals-treeview--state to return treemacs-metals-node-closed-state
;;
(treemacs-define-leaf-node metals-leaf 'dynamic-icon
:ret-action #'lsp-metals-treeview--exec-node-action
:mouse1-action (lambda (&rest args)
(interactive)
(lsp-metals-treeview--exec-node-action args)))

@peterbecich
Copy link

Thanks @jcazevedo , I have solved it temporarily by adding

(require 'treemacs-extensions)

to init.el

@Kazark
Copy link

Kazark commented Oct 31, 2022

I got bit by this too.

@PRESFIL
Copy link

PRESFIL commented Nov 2, 2022

#85 merged.

@erickisos
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants