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

Can the version of the grammar be fixed according to the version of emacs? #99

Open
yuzhou721 opened this issue Apr 22, 2024 · 2 comments

Comments

@yuzhou721
Copy link

yuzhou721 commented Apr 22, 2024

Can the version of the grammar be fixed according to the version of emacs?
Because each installation is the latest version, but emacs treesit does not support that version, causing an error:

(treesit-query-error "Node type error at" 150 "(function_declaration name: (identifier) @font-lock-function-name-face)

Or is it possible to set the version simply?

@renzmann
Copy link
Owner

I imagine this might vary for each grammar. Would the :revision keyword for a recipe, assuming that your grammar's repo has version number tags, do the trick?

@yuzhou721
Copy link
Author

yuzhou721 commented May 17, 2024

https://genehack.blog/2024/02/fixing-an-emacs-typescript-ts-mode-problem/
Actually, that's exactly what I'm doing now.

  (add-to-list 'treesit-auto-recipe-list (make-treesit-auto-recipe
      :lang 'go
      :ts-mode 'go-ts-mode
      :remap 'go-mode
      :requires 'gomod
      :url "https://github.com/tree-sitter/tree-sitter-go"
      :revision "v0.20.0"
      :ext "\\.go\\'"))

I'm not sure if there's another way to do it.

Maintaining an association list (alist) for Emacs versions could be a solution to manage different versions of grammar supported by tree-sit. This alist would map Emacs versions to the compatible tree-sit grammar versions, allowing for more precise control over which version is installed and used.

# 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