From b07f804643fab04b50aa8f6f3dc772af03cdac25 Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Sat, 3 Oct 2015 08:17:34 +0200 Subject: [PATCH 1/3] Ensure char properties are in place in indentation tests --- tests/haskell-indentation-tests.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/haskell-indentation-tests.el b/tests/haskell-indentation-tests.el index f3cdac3a4..5d5fcc2a2 100644 --- a/tests/haskell-indentation-tests.el +++ b/tests/haskell-indentation-tests.el @@ -25,6 +25,7 @@ (require 'cl-lib) (require 'ert) (require 'haskell-mode) +(require 'haskell-font-lock) (require 'haskell-indentation) ;;; Code: @@ -70,6 +71,7 @@ because it helps increase coverage." (haskell-indentation-mode 1) (insert source) (newline) + (font-lock-fontify-buffer) (goto-char (point-min)) (forward-line (1- line)) (move-to-column column) From 8d7d17b9372c90f5d12d44eb2ce8f791e936c33a Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Sat, 3 Oct 2015 08:18:02 +0200 Subject: [PATCH 2/3] Tests for QuasiQuote indentation --- tests/haskell-indentation-tests.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/haskell-indentation-tests.el b/tests/haskell-indentation-tests.el index 5d5fcc2a2..57c79d621 100644 --- a/tests/haskell-indentation-tests.el +++ b/tests/haskell-indentation-tests.el @@ -591,5 +591,18 @@ function (Operation 'Init) = do " ((2 0) 2)) +(hindent-test "29a quasiquote single line" " +test = [randomQQ| This is a quasiquote with the word in |] + +" + ((2 0) 0 7)) + +(hindent-test "29b quasiquote multiple lines" " +test = [randomQQ| This is + a quasiquote + with the word in |] + +" + ((4 0) 0 7)) ;;; haskell-indentation-tests.el ends here From 4852612361927711752bb690afe934342333a19f Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Sat, 3 Oct 2015 08:18:24 +0200 Subject: [PATCH 3/3] Special case QuasiQuotes in indentation --- haskell-indentation.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/haskell-indentation.el b/haskell-indentation.el index d2e79a18c..d3d76c381 100644 --- a/haskell-indentation.el +++ b/haskell-indentation.el @@ -1358,6 +1358,8 @@ line." (if (or (looking-at "'\\([^\\']\\|\\\\.\\)'") (looking-at "'\\\\\\([^\\']\\|\\\\.\\)*'") (looking-at "\"\\([^\\\"]\\|\\\\.\\)*\"") + ;; QuasiQuotes, with help of propertize buffer and string delimeters + (looking-at "\\s\"\\S\"*\\s\"") ;; Hierarchical names always start with uppercase (looking-at "[[:upper:]]\\(\\s_\\|\\sw\\|'\\)*\\(\\.\\(\\s_\\|\\sw\\|'\\)+\\)*")