Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Displaying Julia files using julia-ts-mode fails on Emacs 30.0.5 #21

Open
nameiwillforget opened this issue Apr 19, 2024 · 5 comments · May be fixed by #22
Open

Displaying Julia files using julia-ts-mode fails on Emacs 30.0.5 #21

nameiwillforget opened this issue Apr 19, 2024 · 5 comments · May be fixed by #22

Comments

@nameiwillforget
Copy link

I apologize if this is a basic issue, as I'm very new to using tree-sitter. I followed the installation procedures and now julia-ts-mode is the default major mode for opening .ji files, but when I open such a file with it, there is almost no syntax highlighting at all and I get an error in the messages buffer:

Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 177 "(assignment (identifier) @font-lock-variable-name-face (_)) (assignment (field_expression (identifier) \".\" (identifier) @font-lock-variable-name-face) (operator)) (assignment (bare_tuple (identifier) @font-lock-variable-name-face)) (assignment (bare_tuple (field_expression (identifier) \".\" (identifier) @font-lock-variable-name-face)) (operator)) (local_statement (identifier) @font-lock-variable-name-face) (let_binding (identifier) @font-lock-variable-name-face) (global_statement (identifier) @font-lock-variable-name-face)" "Debug the query with `treesit-query-validate'")

I looked up the function treesit-query-validate, but it wants a query as an argument and I couldn't find out which one. I also tried re-installing julia-ts-mode, but it still didn't work. What could be the issue?

@ronisbr
Copy link
Collaborator

ronisbr commented Apr 19, 2024

Hi @nameiwillforget !

Probably the Julia treesitter grammar has changed and the current julia-ts-mode needs to be updated accordingly. Unfortunately, I do not use Emacs anymore and it will take a while until I can get a working setup here to try fixing the problem (JuliaEditorSupport/julia-emacs#205 (comment)).

I will migrate the repository to JuliaEditorSupport org this weekend hopefully. Maybe someone else can fix the problem faster.

@ronisbr
Copy link
Collaborator

ronisbr commented Apr 19, 2024

Btw @nameiwillforget, can you try with emacs 29?

@tpapp
Copy link

tpapp commented Apr 22, 2024

Just a quick note: given that Emacs 30 is, at the moment, unreleased, and we are just integrating this code, fixing stuff on Emacs 30 is unlikely to be a priority of the maintainers. Users are advised to use Emacs 29.x for the moment.

@hexaeder
Copy link

I also encounter this problem on emacs 29.3 in WSL2 environment.

Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 177 "(assignment (identifier) @font-lock-variable-name-face (_)) (assignment (field_expression (identifier) \".\" (identifier) @font-lock-variable-name-face) (operator)) (assignment (bare_tuple (identifier) @font-lock-variable-name-face)) (assignment (bare_tuple (field_expression (identifier) \".\" (identifier) @font-lock-variable-name-face)) (operator)) (local_statement (identifier) @font-lock-variable-name-face) (let_binding (identifier) @font-lock-variable-name-face) (global_statement (identifier) @font-lock-variable-name-face)" "Debug the query with `treesit-query-validate'")

There are a few things happening currently in the grammar repo, maybe it just fails when you're rebuilding the grammar as of now?

@hexaeder
Copy link

Yep, confirmed. How to fix it temporarily: call this function for the interactive grammar install process

(treesit-install-language-grammar 'julia)

For repo use https://github.com/tree-sitter/tree-sitter-julia, for branch/revision use v0.20.0 (which is the tag before the current v0.22.0).

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

Successfully merging a pull request may close this issue.

4 participants