KaranAhlawat / scala-ts-mode

A tree-sitter based Emacs major-mode for the Scala programming language
GNU General Public License v3.0
32 stars 4 forks source link
emacs scala tree-sitter

+TITLE: scala-ts-mode

+PROPERTY: LOGGING nil

The major-mode is mostly complete and in a very usable state currently. Improvements will come as I find bugs, edge cases, more use cases or the upstream grammar evolves.

** MELPA

+begin_src emacs-lisp

(straight-use-package 'scala-ts-mode)

+end_src

** Source

+BEGIN_SRC emacs-lisp

(straight-use-package '(scala-ts-mode :type git :host github :repo "KaranAhlawat/scala-ts-mode"))

+END_SRC

Then, you can simply call ~scala-ts-mode~ in a Scala buffer.

+begin_src emacs-lisp

(setq treesit-font-lock-level 4)

+end_src

The default font lock level is 3. At that level, not as many constructs are highlighted as you might like. Increasing it to 4 results in richer highlighting.