Closed hmanhng closed 7 months ago
It seems treesit-auto is not doing its job
treesit-auto-install-all
also nothing happened
Thank you for the feedback @hmanhng ,
It seems weird! You can temporarily add (push 'nix-ts-mode minemacs-disabled-packages)
to your modules.el
in order to disable the package until I take a look at it!
As I understand it, the following 2 lines will push treesit are not installed to treesit-auto-langs but when I check the variable treesit-auto-langs
it returns nil. Perhaps the error lies here ?
@hmanhng
Yep, you're right!
It seems that seq-difference
expects the bigger set to be the first one! I've pushed a fix, can you pull it and try again?
Thanks again
Now it works with other languages except nix-ts-mode
. There are 2 issue with nix-ts-mode
treesit-auto
, tree-sitter-nix
), when I try both nix-mode
and nix-ts-mode
they don't install automatically, but treesit-auto-install-all
did install tree-sitter-nix
and worked on both nix-mode
and nix-ts-mode
https://github.com/abougouffa/minemacs/commit/3c5d6e9cd237d1206688b410b27263c9bcf3c350 I don't know why you deleted these lines, it will remove nix
from treesit-auto-langs
and make it impossible to install
What I wanted to achieve with these lines https://github.com/abougouffa/minemacs/commit/3c5d6e9cd237d1206688b410b27263c9bcf3c350 was to only try to install language grammars that are not already installed (due to an issue with a previous version of treesit-auto
. However, setting the treesit-auto-langs
this way resulted in an empty list, which disables the mode mapping (i.e. mapping x-mode
to x-ts-mode
).
Can you confirm that the libtree-sitter-nix.so
has been installed (to ~/.emacs.d/local/tree-sitter/
) ?
When reverting https://github.com/abougouffa/minemacs/commit/3c5d6e9cd237d1206688b410b27263c9bcf3c350, Emacs won't remap the modes when the grammars are installed. Practically, it will only work on the first session (when grammars aren't installed), and once installed and restarted Emacs, it will raise other problems.
For example, see: https://github.com/renzmann/treesit-auto/blob/07a8f924cd4f020a2eb32b45d8543af9556f355d/treesit-auto.el#L461C30-L461C30
The (treesit-auto--selected-recipes)
function (which depends on treesit-auto-langs
) is used in several places. Which make any change to treesit-auto-langs
affect this.
if there is no nix
in treesit-auto-langs
then I won't be able to install it even with treesit-auto-install-all
Indeed. Well in this case, just adding nix
to treesit-auto-langs
will fix the issue.
I've pushed a fix for this.
Thanks for you patience! @hmanhng
Describe the bug I enabled the me-progs module as well as me-tools, opened a .nix file with nix-ts-mode seems like treesitter is not working, when I
Mx nix-mode
the syntax is highlighted. Sorry if my English is not good.Emacs version
Checkup list
config.el
usingMINEMACS_IGNORE_CONFIG_EL=1 emacs
?Modules
Backtrace If the bug rises an error, please attach the full backtrace. To be sure to obtain a backtrace, you should launch Emacs with
MINEMACS_DEBUG=1 emacs
oremacs --debug-init
.Screenshots If applicable, add screenshots to help explain your problem.![image](https://github.com/abougouffa/minemacs/assets/64454245/ed4ea58f-240d-477d-9fb6-02460f6cd869)
Additional context I tried running removing the nix-ts-mode package with
MINEMACS_DEBUG=1 emacs
and it worked fine, it seems the error is coming from nix-ts-mode.