From b8be64f3b5ee8d556e1167b67c2355f24ced63b5 Mon Sep 17 00:00:00 2001 From: Aria Edmonds Date: Sat, 23 Feb 2019 03:20:45 +1100 Subject: [PATCH 1/4] Add haskell lsp mode --- modules/lang/haskell/+lsp.el | 8 ++++++++ modules/lang/haskell/config.el | 3 ++- modules/lang/haskell/packages.el | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 modules/lang/haskell/+lsp.el diff --git a/modules/lang/haskell/+lsp.el b/modules/lang/haskell/+lsp.el new file mode 100644 index 000000000..d963d3e83 --- /dev/null +++ b/modules/lang/haskell/+lsp.el @@ -0,0 +1,8 @@ +;;; lang/haskell/+lsp.el -*- lexical-binding: t; -*- + +(def-package! lsp-haskell + :after haskell-mode + :init (add-hook 'haskell-mode-hook #'lsp) + :config + ;; Does some strange indentation if it pastes in the snippet + (setq company-lsp-enable-snippet nil)) diff --git a/modules/lang/haskell/config.el b/modules/lang/haskell/config.el index aedfce663..a62a64d87 100644 --- a/modules/lang/haskell/config.el +++ b/modules/lang/haskell/config.el @@ -1,7 +1,8 @@ ;;; lang/haskell/config.el -*- lexical-binding: t; -*- (cond ((featurep! +intero) (load! "+intero")) - ((featurep! +dante) (load! "+dante"))) + ((featurep! +dante) (load! "+dante")) + ((featurep! +lsp) (load! "+lsp"))) ;; ;; Common packages diff --git a/modules/lang/haskell/packages.el b/modules/lang/haskell/packages.el index ec400afaf..b2fd48e5e 100644 --- a/modules/lang/haskell/packages.el +++ b/modules/lang/haskell/packages.el @@ -7,4 +7,6 @@ (package! dante) (package! attrap)) ((featurep! +intero) - (package! intero))) + (package! intero)) + ((featurep! +lsp) + (package! lsp-haskell))) From a070343e2205354681e8474207b218bcfc57b05d Mon Sep 17 00:00:00 2001 From: Aria Edmonds Date: Sat, 23 Feb 2019 15:15:38 +1100 Subject: [PATCH 2/4] haskell +lsp: change lsp to +lsp|init --- modules/lang/haskell/+lsp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/haskell/+lsp.el b/modules/lang/haskell/+lsp.el index d963d3e83..80bcec789 100644 --- a/modules/lang/haskell/+lsp.el +++ b/modules/lang/haskell/+lsp.el @@ -2,7 +2,7 @@ (def-package! lsp-haskell :after haskell-mode - :init (add-hook 'haskell-mode-hook #'lsp) + :init (add-hook 'haskell-mode-hook #'+lsp|init) :config ;; Does some strange indentation if it pastes in the snippet (setq company-lsp-enable-snippet nil)) From 69a6e60f84e578b4b5a5c6efa693010c3a51fe7a Mon Sep 17 00:00:00 2001 From: Aria Edmonds Date: Tue, 26 Feb 2019 02:18:37 +1100 Subject: [PATCH 3/4] lang/haskell +lsp: enable snippet completion --- modules/lang/haskell/+lsp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/haskell/+lsp.el b/modules/lang/haskell/+lsp.el index 80bcec789..a958773fe 100644 --- a/modules/lang/haskell/+lsp.el +++ b/modules/lang/haskell/+lsp.el @@ -5,4 +5,4 @@ :init (add-hook 'haskell-mode-hook #'+lsp|init) :config ;; Does some strange indentation if it pastes in the snippet - (setq company-lsp-enable-snippet nil)) + (setq yas-indent-line 'fixed)) From 9c085c0553450084a96f7c4ccf83c90d63331ca8 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 25 Feb 2019 22:26:13 -0500 Subject: [PATCH 4/4] Set yas-indent-line only in haskell-mode --- modules/lang/haskell/+lsp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/haskell/+lsp.el b/modules/lang/haskell/+lsp.el index a958773fe..7a718ca70 100644 --- a/modules/lang/haskell/+lsp.el +++ b/modules/lang/haskell/+lsp.el @@ -5,4 +5,4 @@ :init (add-hook 'haskell-mode-hook #'+lsp|init) :config ;; Does some strange indentation if it pastes in the snippet - (setq yas-indent-line 'fixed)) + (setq-hook! 'haskell-mode-hook yas-indent-line 'fixed))