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

tree-edit-install-grammars-wizard fails with Spacemacs and Emacs 29.1 #71

Open
idanov opened this issue Mar 20, 2024 · 2 comments
Open

Comments

@idanov
Copy link

idanov commented Mar 20, 2024

Trying to install the grammars on Spacemacs and GNU Emacs 29.1 (build 1, aarch64-apple-darwin22.6.0, Carbon Version 169 AppKit 2299.7)
of 2023-10-02 (emacs-mac) on macOS.

This is the error backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp python)
  expand-file-name(python "/var/folders/h3/z04wl7k51xq60dm13cx9_g940000gn/T/t...")
  tree-edit-install-language-grammar(python)
  tree-edit-install-grammars-wizard(t t)

Is there a way to install the grammars manually?

@ethan-leba
Copy link
Owner

Hey there, thanks for checking out the project! I'm having trouble reproducing this unfortunately but I think I have a hunch...
What's the value of treesit-language-source-alist in your Emacs? It looks like the error is originating from this line:

((url revision source-dir) (alist-get lang treesit-language-source-alist))
(grammar
(expand-file-name "grammar.json" (expand-file-name (or source-dir "src") workdir))))

My guess is you have it set with a python key that has the source-dir set to 'python? Could be off base though.

Unfortunately you need to install the grammars via tree-edit so it can generate some special files used for structural editing -- happy to help though, let me know if resetting treesit-language-source-alist works!

@idanov
Copy link
Author

idanov commented Mar 26, 2024

Thanks for responding!

I've never set it myself, the variable is nil and only after I run tree-edit-install-grammars-wizard, I get this error. And then the value of the variable is as follows:

Its value is (#1=(python . #1#))

After trying to set it as the example here, tree-edit-install-grammars-wizard inserts the same value to the front of the list and fails the same way. If I try to install it normally with treesit-install-language-grammar, this value doesn't get inserted to the list. So something in the code of the wizard is modifying the treesit-language-source-alist and then it's unhappy with the modification.

Hope that gives some more info.

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

2 participants