[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-ts-mode ef35522e99 5/8: Fixed indent for (parent-i
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-ts-mode ef35522e99 5/8: Fixed indent for (parent-is "match") scinario |
Date: |
Mon, 16 Sep 2024 10:00:12 -0400 (EDT) |
branch: elpa/haskell-ts-mode
commit ef35522e995d89c028c37daba5c2fa84fd004787
Author: pranshu sharma <pranshu@pebl>
Commit: pranshu sharma <pranshu@pebl>
Fixed indent for (parent-is "match") scinario
Before it used to end up in the catch all fallback
---
haskell-ts-mode.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index 54e8e02de2..e56cafa266 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -182,7 +182,9 @@
n)))
(p-prev-sib
(lambda (node _ _) (treesit-node-start (funcall p-sib node t))))
- (p-n-prev (lambda (node) (funcall p-sib node t))))
+ (p-n-prev (lambda (node) (funcall p-sib node t)))
+ (parent-first-child (lambda (_ parent _)
+ (treesit-node-start (treesit-node-child parent
0)))))
`((haskell
((node-is "comment")
;; Indenting comments by priorites:
@@ -203,11 +205,7 @@
((parent-is "imports") column-0 0)
;; Infix
((node-is "infix") standalone-parent 1)
- ((parent-is "infix")
- ;; Parent's first child
- (lambda (_ parent _)
- (treesit-node-start (treesit-node-child parent 0)))
- 0)
+ ((parent-is "infix") ,parent-first-child 0)
;; Lambda
((parent-is "lambda") standalone-parent 2)
@@ -268,9 +266,10 @@
;; Match
((lambda (node _ _)
(and (string= "match" (treesit-node-type node))
- (string= "variable" (treesit-node-type (funcall ,p-n-prev
node)))))
- parent 1)
- ((node-is "match") ,p-prev-sib 0)
+ (string= "variable" (treesit-node-type (funcall ,p-n-prev
node))) ))
+ ,parent-first-child 1)
+ ((node-is "match") ,p-prev-sib 0)
+ ((parent-is "match") standalone-parent 2)
((parent-is "haskell") column-0 0)
((parent-is "declarations") column-0 0)
@@ -280,6 +279,8 @@
(lambda (_ b _) (treesit-node-start (treesit-node-prev-sibling b)))
0)
((n-p-gp nil "signature" "foreign_import") grand-parent 3)
+
+ ((parent-is "case") parent 4)
;; Backup
(catch-all parent 2)))))
- [nongnu] elpa/haskell-ts-mode updated (bf632cba27 -> 575748b9a5), ELPA Syncer, 2024/09/16
- [nongnu] elpa/haskell-ts-mode ef35522e99 5/8: Fixed indent for (parent-is "match") scinario,
ELPA Syncer <=
- [nongnu] elpa/haskell-ts-mode 739415d37d 1/8: Indent fixes(just for consistancy), ELPA Syncer, 2024/09/16
- [nongnu] elpa/haskell-ts-mode 59b146204b 6/8: Fixed indent of ']', ELPA Syncer, 2024/09/16
- [nongnu] elpa/haskell-ts-mode 2280feefe6 3/8: Comment fixed, ELPA Syncer, 2024/09/16
- [nongnu] elpa/haskell-ts-mode 575748b9a5 8/8: Indent changes to comment, case, infix, ELPA Syncer, 2024/09/16
- [nongnu] elpa/haskell-ts-mode a2b07815bc 2/8: shortening statmenet, ELPA Syncer, 2024/09/16
- [nongnu] elpa/haskell-ts-mode cf0c9c308c 4/8: Changed indentation of infix, ELPA Syncer, 2024/09/16
- [nongnu] elpa/haskell-ts-mode eea9607a42 7/8: Forgot defvar + indent of case fixed, ELPA Syncer, 2024/09/16