# Emacs julia-ts-mode

**URL:** <https://discourse.julialang.org/t/emacs-julia-ts-mode/122018>\
**Category:** Tooling\
**Created:** [October 30, 2024, 7:33pm UTC](https://discourse.julialang.org/t/emacs-julia-ts-mode/122018 "2024-10-30T19:33:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![warnerwarner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/warnerwarner/32/210444_2.png) [@warnerwarner](https://discourse.julialang.org/u/warnerwarner)\
**Post date:** [October 30, 2024, 7:33pm UTC](https://discourse.julialang.org/t/emacs-julia-ts-mode/122018/1 "2024-10-30T19:33:28Z")

</div>

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

```julia

(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

```julia
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!

---

<div class="post-metadata">

**Author:** ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Post date:** [October 30, 2024, 9:22pm UTC](https://discourse.julialang.org/t/emacs-julia-ts-mode/122018/2 "2024-10-30T21:22:19Z")

</div>

I think the latest Julia-ts-mode is not compatible with the latest grammar. Either install [this patched version of jula ts mode](https://github.com/JuliaEditorSupport/julia-ts-mode/pull/22) or follow [these instructions](https://github.com/JuliaEditorSupport/julia-ts-mode/issues/21#issuecomment-2126885445) to install an older grammar.

---

<div class="post-metadata">

**Author:** ![warnerwarner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/warnerwarner/32/210444_2.png) [@warnerwarner](https://discourse.julialang.org/u/warnerwarner)\
**Post date:** [October 30, 2024, 10:02pm UTC](https://discourse.julialang.org/t/emacs-julia-ts-mode/122018/3 "2024-10-30T22:02:17Z")

</div>

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