-
Notifications
You must be signed in to change notification settings - Fork 83
Loading Combobulate into non-tree-sitter-enabled major modes #145
Description
The Readme.md mentions:
Combobulate works in non-tree-sitter-enabled major modes as well as the new Emacs 29 tree-sitter modes.
I would like to understand how I can make this work and what is expected to work. I'm working on Combobulate support for a few of my favourite languages (OCaml and Haskell) and neither of their main modes support tree-sitter just yet.
I have a basic skeleton like so, when I activate Combobulate and try using it I get an error saying "No parsers available"
(eval-and-compile
(defconst combobulate-ocaml-definitions
;; ... DEFINITIONS ...
)))
(define-combobulate-language
:name ocaml
:language ocaml
:major-modes (tuareg-mode)
:custom combobulate-ocaml-definitions
:extra-defcustoms combobulate-ocaml-definitions
:setup-fn combobulate-ocaml-setup)
(defun combobulate-ocaml-setup (_))
(provide 'combobulate-ocaml)
That makes sense, I probably need to load the tree-sitter grammar for OCaml. The main example I could find was rust-mode which provides a defcustom for rust-mode-treesitter-derive which loads a full rust-ts-mode. Is there an option to just load the parser using something like treesit-parser-create while leaving the non-tree-sitter-enabled major mode in charge?
WIP code tmcgilchrist#1