renzmann / treesit-auto

Automatic installation, usage, and fallback for tree-sitter major modes in Emacs 29
GNU General Public License v3.0
369 stars 28 forks source link

There is no recipe for c++ #14

Closed ronisbr closed 1 year ago

ronisbr commented 1 year ago

When I open a C++ file, it shows the message:

There is no recipe for c++, do you want to build it interactively?

Even after building the C++ grammar, tree-sitter does not work. I think the problem is related with the language name c++ instead of cpp.

renzmann commented 1 year ago

Ah yeah, https://github.com/renzmann/treesit-auto/blob/40ccc0dc97a3b13f4497a310264a9723baef920e/treesit-auto.el#L82

Should be

    (c++ "https://github.com/tree-sitter/tree-sitter-cpp")

However, there's another issue when I compile this:

⛔ Warning (treesit): The installed language grammar for c++ cannot be located or has problems (symbol-error): /home/robb/.emacs.d/tree-sitter/libtree-sitter-c++.so: undefined symbol: tree_sitter_c++

~I bet it's because scanner.cc is separate in the src directory, but need to look into how to pass that information to treesit-install-language-grammar~

Actually it's a bit deeper: I made an assumption that the mode name (in this case c++) would always match the tree-sitter language symbol, (which is cpp in the parser). That should mean a little fix to treesit-auto--extract-lang to handle special cases like this.

Thanks for the bug report! Expect a fix pretty soon.