emacs-lsp / lsp-treemacs

lsp-mode :heart: treemacs
GNU General Public License v3.0
403 stars 48 forks source link

Getting `(invalid-function (icon (plist-get item :icon)))` when calling `(lsp-treemacs-call-hierarchy)` #140

Open Naomarik opened 2 years ago

Naomarik commented 2 years ago

If I remove the surrounding parenthesis on ((icon (plist-get item :icon)) found https://github.com/emacs-lsp/lsp-treemacs/blob/master/lsp-treemacs-generic.el#L82 it works for me, but have no experience in elisp to tell what that's doing.

Running latest doom emacs.

visd0m commented 1 year ago

Hi everyone, I have the same problem, any news on this?

alanz commented 1 year ago

I'ts weird, on GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2021-11-27, modified by Debian, whether I have the parens or not, emacs-lisp-macroexpand gives the same result

   (or (plist-get item :icon-literal)
       (if-let*
           ((icon
             (plist-get item :icon)))
           (treemacs-get-icon-value icon nil lsp-treemacs-theme)
         "   "))))

But if I remove the parens, reload the function, it then no longer gives the error, and the call hierarchy displays.

So at the very least this change should be safe, however it actually causes a problem

Naomarik commented 1 year ago

Updating emacs from 27.1 to 28.1 solved this for me.

tl072 commented 1 year ago

I'ts weird, on GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2021-11-27, modified by Debian, whether I have the parens or not, emacs-lisp-macroexpand gives the same result

   (or (plist-get item :icon-literal)
       (if-let*
           ((icon
             (plist-get item :icon)))
           (treemacs-get-icon-value icon nil lsp-treemacs-theme)
         "   "))))

But if I remove the parens, reload the function, it then no longer gives the error, and the call hierarchy displays.

So at the very least this change should be safe, however it actually causes a problem

I just did this on emacs28 and it fixed the issue - i.e.

   (if-let*
       (icon
         (plist-get item :icon))

so weird...

bridgesense commented 1 year ago

I just did this on emacs28 and it fixed the issue - i.e.

I can confirm that this fix also works on emacs 27.2.50.

Thanks!

traderLaval commented 1 year ago

I confirm too, now it works fine :-)