fsharp-ts-mode
is a tree-sitter based GNU Emacs major mode built on top of the Emacs 29+ treesit
library. It provides the following features in a F# buffer-
- efficient font-locking using tree-sitter
imenu
integration (unimplemented)- indentation support using tree-sitter (unimplemented)
This is very experimental at the moment, but steady work is being done.
To use the package, the following dependencies are required.
- GNU Emacs 29+, built with support for tree-sitter.
- tree-sitter grammar for F# (you can use the
treesit-install-language-grammar
function for installing it.)
Currently, you can only install the package from source, although you can use a package manager like straight.el (or any other of your choice) to simplify this process for you.
(straight-use-package '(fsharp-ts-mode :type git :host github :repo "KaranAhlawat/fsharp-ts-mode"))
Then, you can simply call fsharp-ts-mode
in a Scala buffer.
You may wish to customize treesit-font-lock-level
, using M-x customize-variable
or by adding a line such as this to your user init file:
(setq treesit-font-lock-level 4)
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.
Contributions are welcome! These can be in the form of PRs, Issues, or any other way you can think of. This is my first package, so please don’t hold back :)
GPLv3