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

Fix lsp-metals initialization #90

Closed

Conversation

prashantvithani
Copy link

Temporary fix for #81 Eager macro-expansion failure: %S" (wrong-number-of-arguments (1 . 1) 0

This error is occurring even after (require treemacs-extensions) fix. Just passing an argument works.

Temporary fix for emacs-lsp#81
`Eager macro-expansion failure: %S" (wrong-number-of-arguments (1 . 1) 0`

This error is occurring even after `(require treemacs-extensions)` fix.
Just passing an argument works.
@kurnevsky
Copy link
Member

In which case does this error occur? I haven't seen it, and not a lot of people complain about it. I believe the function we want to use is this one: https://github.com/Alexander-Miller/treemacs/blob/f372f2cbfa443c97cb383c2b05a13cb13349cbb6/src/elisp/treemacs-extensions.el#L540 which doesn't take arguments.

@prashantvithani
Copy link
Author

In which case does this error occur? I haven't seen it, and not a lot of people complain about it. I believe the function we want to use is this one: Alexander-Miller/treemacs@f372f2c/src/elisp/treemacs-extensions.el#L540 which doesn't take arguments. This patch solved the problem for me.

I'm not sure what exactly is happening here, The macro definition in treemacs-treelib has the same name treemacs-initialize and it requires an argument.

What seems to be happening here - even after explicit require treemacs-extensions - is the calling treemacs-initialize is referenced to the macro instead of function; hence throwing wrong-number-of-arguments error.

I'm open to an alternate, better solution if I can fix the function override from `treemacs-extensions.

@kurnevsky
Copy link
Member

kurnevsky commented May 31, 2023

What do you get from C-h f treemacs-initialize? And what is your emacs and lsp-metals versions?

@prashantvithani
Copy link
Author

What do you get from C-h f treemacs-initialize? And what is your emacs and lsp-metals versions?

@kurnevsky sorry for missing this, this is what I get:

treemacs-initialize is a macro defined in treemacs-treelib.el.

Signature
(treemacs-initialize EXTENSION &key (WITH-EXPAND-DEPTH 0) AND-DO)

Documentation
Initialise an external buffer for use with the given EXTENSION.

EXTENSION is the same symbol that was passed as a :key argument
to treemacs-define-variadic-entry-node-type.

WITH-EXPAND-DEPTH indicates the number of nodes that should be expanded *in
addition* to the default.  If a value is given that is not a number then
treemacs will assume that *all* possible nodes should be expanded.

AND-DO can be used to set up buffer-local variables after the buffer has
switched over to treemacs-mode.

References
treemacs-initialize is unused in treemacs-treelib.el.

The emacs version is: 30.0.50 master b9a910a70 ~/.emacs.d/
lsp-metals version is: a2df726

@kurnevsky
Copy link
Member

Do you get the same after executing (require 'treemacs-extensions)? It could be that they changed something in emacs 30. But if we just add an argument there it will break it for everyone else.

@kurnevsky
Copy link
Member

Not relevant anymore, #102

@kurnevsky kurnevsky closed this Sep 28, 2023
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

Successfully merging this pull request may close these issues.

2 participants