[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode adb3c50 143/385: better insert indentatio
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode adb3c50 143/385: better insert indentation suggestions |
Date: |
Tue, 5 Oct 2021 23:59:18 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit adb3c50efb1ddbccfac126a0488d1d674fe44f7a
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
better insert indentation suggestions
---
haskell-tng-smie.el | 13 ++++---------
test/src/indentation.hs.insert.indent | 10 +++++-----
test/src/indentation.hs.reindent | 10 +++++-----
3 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index db485c9..b4ebc93 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -144,10 +144,10 @@ information, to aid in the creation of new rules."
;; the parameter requirements for function calls. For simple cases, we
;; should be able to infer if the user wants to terminate ; or continue
;; "" the current line.
- ;;
- ;; TODO if there is already an empty lines before here, perhaps best to
- ;; close out the indentation with a }.
- ('empty-line-token ";")
+ ('empty-line-token
+ ;; BUG smie-rule-next-p needs smie--after to be defined
+ (setq smie--after (point))
+ (when (smie-rule-next-p ";" "}") ";"))
))
;; Patterns of the form
@@ -157,8 +157,6 @@ information, to aid in the creation of new rules."
;; get called with `:list-intro "HEAD"` when indenting positions A and B.
(:list-intro
(pcase arg
- ;; TODO work out why we need these list-intro rules. Re-indentation of
- ;; continued lines in WLDOs don't behave as expected without.
((or "<-" "=") t)
))
@@ -268,9 +266,6 @@ current line."
#'haskell-tng-smie:rules
:forward-token #'haskell-tng-lexer:forward-token
:backward-token #'haskell-tng-lexer:backward-token)
-
- ;; disables blinking paren matching based on grammar
- (setq smie-closer-alist nil)
)
;; SMIE wishlist, in order of desirability:
diff --git a/test/src/indentation.hs.insert.indent
b/test/src/indentation.hs.insert.indent
index 442c096..9578e89 100644
--- a/test/src/indentation.hs.insert.indent
+++ b/test/src/indentation.hs.insert.indent
@@ -35,9 +35,9 @@ basic_do = do
foo <- blah blah blah
1 v
bar <- blah blah
-2 v 1
+2 1 v
blah -- manual correction
-2 v 1
+1 2 v
blah -- manual correction
2 v 1
sideeffect
@@ -45,7 +45,7 @@ basic_do = do
sideeffect' blah
2 v 1 3
let baz = blah blah
-3 1 v 4 2
+3 2 1 4 v
blah -- manual correction
2 3 v 4 1
gaz = blah
@@ -69,13 +69,13 @@ nested_do = -- manual correction
1 2 v
nested_where a b = foo a b
-v
+1 v
where -- TODO 2
1 v
foo = bar baz -- indented
1 v
baz = blah blah -- same level as foo
-1 v
+2 1 v
where -- manual correction
1 2 v
gaz a = blah -- indented
diff --git a/test/src/indentation.hs.reindent b/test/src/indentation.hs.reindent
index f9fa74f..6428102 100644
--- a/test/src/indentation.hs.reindent
+++ b/test/src/indentation.hs.reindent
@@ -84,19 +84,19 @@ v 2 1
faz = blah -- same level as gaz
1 2 v
-v 1 2
+1 2 3 v
-- TODO case statements
-v 1 2
+1 2 3 v
-- TODO let / in
1 2 v
-v 1 2
+1 2 3 v
-- TODO coproduct definitions, the | should align with =
1 2 v
-v 1 2
+1 2 3 v
-- TODO lists, records, tuples
1 2 v
-v 1 2
+1 2 3 v
-- TODO long type signatures vs definitions
\ No newline at end of file
- [nongnu] elpa/haskell-tng-mode 01789b1 075/385: y u no haskell-mode?, (continued)
- [nongnu] elpa/haskell-tng-mode 01789b1 075/385: y u no haskell-mode?, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b8f3e3f 079/385: back out incomplete grammar rules, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9e19b2b 080/385: double down on simpler grammar, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6e7a24f 083/385: lexer identifies conid / varid, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b12e49a 086/385: consym, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7d6fa3d 091/385: thoughts on lexers, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6a05d12 090/385: planning for indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2060f7a 092/385: thoughts on indentation testing, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6d2d764 094/385: skeleton for indentation tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 0d04664 115/385: implement batch compilation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode adb3c50 143/385: better insert indentation suggestions,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode e79577e 132/385: match ghc source paths when compiling, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8ec4807 145/385: somehow dropped font-lock-extend-region-multiline, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d3a6a22 147/385: no todos in the test/src dir, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 85f20b1 154/385: indent coproducts, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3dbb883 013/385: more progress on multiline type expansion, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c6382e1 036/385: almost got it with imports, then I lost it..., ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f3e3838 070/385: starting to transcribe the expression table, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ceaec13 098/385: groundwork for tab cycling, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8b6d545 178/385: split all the tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4e1f51c 170/385: indent is deriving aware, ELPA Syncer, 2021/10/06