heex-ts-mode
<- html-mode
<- sgml-mode
<- text-mode
<- nil
. Which means users may trigger (and conversely not trigger) behavior they have setup in text-mode
(and conversely prog-mode
).For a concrete example, the default completion-at-point keybinding is taken over by ispell
in text-mode. This was unexpected since heex-ts-mode
, is primarily a programming buffer, even if you're just mostly writing templates.
What are your thoughts on making it derive from prog-mode
or web-mode
rather than html-mode
?
"
I think I agree, as HEEx is just Elixir looking like some html syntax. Language servers and other tools should treat this as Elixir, not text. Testing this change on my side with a very light setup shows that it has no negative impact. The wider impact of such a change is unknown to me.
The original decision for deriving from html-mode was because I followed how erb-mode ( ruby markup ) works, which might have been a mistake.
This is the proposed change:
---
lisp/progmodes/heex-ts-mode.el | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/lisp/progmodes/heex-ts-mode.el b/lisp/progmodes/heex-ts-mode.el
index b527d96b579..ab40d4819e8 100644
--- a/lisp/progmodes/heex-ts-mode.el
+++ b/lisp/progmodes/heex-ts-mode.el
@@ -143,7 +143,7 @@ heex-ts--forward-sexp
(abs arg)))
;;;###autoload
-(define-derived-mode heex-ts-mode html-mode "HEEx"
+(define-derived-mode heex-ts-mode prog-mode "HEEx"
"Major mode for editing HEEx, powered by tree-sitter."
:group 'heex-ts
@@ -168,16 +168,6 @@ heex-ts-mode
("Slot" "\\`slot\\'" nil nil)
("Tag" "\\`tag\\'" nil nil)))
- ;; Outline minor mode
- ;; `heex-ts-mode' inherits from `html-mode' that sets
- ;; regexp-based outline variables. So need to restore
- ;; the default values of outline variables to be able
- ;; to use `treesit-outline-predicate' derived
- ;; from `treesit-simple-imenu-settings' above.
- (kill-local-variable 'outline-heading-end-regexp)
- (kill-local-variable 'outline-regexp)
- (kill-local-variable 'outline-level)
-
(setq-local treesit-font-lock-settings heex-ts--font-lock-settings)
(setq-local treesit-simple-indent-rules heex-ts--indent-rules)
--
Wilhelm