Skip to content
New issue

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

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

Already on GitHub? # to your account

C++ mode requires another mode and its installation is not handled #104

Open
lifeisfoo opened this issue May 13, 2024 · 1 comment
Open

Comments

@lifeisfoo
Copy link

Opening a C++ file requires the C++ grammar to be installed but it seems that another grammar is also required in order to activate tree-sitter.

Even after an emacs restart, trying to open a C++ file throws this error:

Warning (treesit): Cannot activate tree-sitter, because language grammar for c is unavailable (not-found): (libtree-sitter-c libtree-sitter-c.0 libtree-sitter-c.0.0 libtree-sitter-c.so libtree-sitter-c.so.0 libtree-sitter-c.so.0.0) No such file or directory


Setup code:

 (use-package treesit-auto
   :ensure t
   :custom
   (treesit-auto-install 'prompt)
   :config
   (treesit-auto-add-to-auto-mode-alist 'all)
   (global-treesit-auto-mode))
@renzmann
Copy link
Owner

renzmann commented May 16, 2024

As it stands, I don't have the C++ grammar requiring C:

,(make-treesit-auto-recipe
:lang 'cpp
:ts-mode 'c++-ts-mode
:remap 'c++-mode
:url "https://github.com/tree-sitter/tree-sitter-cpp"
:ext "\\.cpp\\'")

Looks like we'll need to add :requires 'c to the cpp recipe.

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

No branches or pull requests

2 participants