Emacs julia-ts-mode

I’ve tried to set up julia-ts-mode using treesitter-auto in emacs, but whenever I open a julia .jl file there is no treesitting changes e.g. no syntax highlighting etc. I’m using it conjunection wtih julia-snail, but from what I understand that shouldn’t matter?

This is the relevant part of my init.el file


(use-package julia-ts-mode
  :ensure t
  :mode "\\.jl$")

(use-package julia-snail
  :ensure t
  :custom
  (julia-snail-terminal-type :eat)
  :hook
  (julia-ts-mode . julia-snail-mode))

(use-package treesit-auto
  :ensure t
  :custom
  (treesit-auto-install 'prompt)
  :config
  (treesit-auto-add-to-auto-mode-alist 'all)
  (global-treesit-auto-mode))

;; Tree sitter
(setq treesit-language-source-alist
      '((julia "https://github.com/tree-sitter/tree-sitter-julia")
	(python "https://github.com/tree-sitter/tree-sitter-python")))

I’d initially tried installing the language grammar using treesitter but I don’t think that was working correctly either, so I uninstalled the treesitter grammar and when I navigated to a .jl I was prompted to install with treesitter-auto. However, after the installation I got an error

File mode specification error (tree sitter for julia is not available)

Whenever I open a .jl file now I don’t get any prompt and it says Julia (TS) in the buffer bar at the bottom so I think it is trying to use julia-ts-mode?

Any help would be greatly appreciated!

1 Like

I think the latest Julia-ts-mode is not compatible with the latest grammar. Either install this patched version of jula ts mode or follow these instructions to install an older grammar.

Thank you so much! This was definitely the issue. I should have read through the github issues more closely.