For those who don't know, tree-sitter is "an incremental parsing system". What it basically means is that it provides fancy syntax highlighting by doing a thorough analysis of the code.
Emacs has treesitter integration via the `tree-sitter` package. I was using tree-sitter before on neovim and it really great. Well, I'm trying to set it up in emacs and it's pure frustration.
I've installed the package, and it says that you should also install a language pack. Well, since I was already using treesitter before, then I prefer to not have to compile the language parsers twice, so I decided to unify it in a single directory for both neovim and emacs. Making the change on neovim was a piece of cake. On emacs, I pushed to the `tree-sitter-load-path` list, and it seems to work... kinda. If I manually call `tree-sitter-require 'python` for example, it does load the language parser, it even gets listed in `tree-sitter-languages`. However, it doesn't get enabled, the syntax is the same.
The variable `tree-sitter-language` is not getting set. Apparently tree-sitter should map each language major mode to a tree-sitter parser, but it ain't doing it for some reason. Trying to enable treesitter on a python file results in the error "No language registered for "python-mode"".
Also what about these major modes for each language? I don't want a major mode for each language. I want emacs to open a file, recognize what it is by its extension or otherwise, and that's it. I want highlighting to be handled by treesitter, but it apparently needs to interact with these major modes (of which I need to install more if I want to support other languages) that don't really add anything to me other than bloat. Is there a workaround?