-
Notifications
You must be signed in to change notification settings - Fork 0
/
hc-lsp-pick.el
65 lines (47 loc) · 1.45 KB
/
hc-lsp-pick.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
;;; hc-lsp-pick --- Summary
;;; Commentary:
;;;;
;;;; Created : ... by Harold Carr.
;;;; Last Modified : 2023 Aug 17 (Thu) 09:13:03 by Harold Carr.
;;;;
;;; Code:
(eval-when-compile (require 'use-package))
;;; Haskell Packages
(defvar hc-haskell-pick)
(defvar hc-rust-pick)
(defun hc-pick-lsp-support ()
"Prompt pick from a list."
(interactive)
(let ((choices '("eglot" "lsp" "none")))
(message "%s" (ido-completing-read "IDE pick: " choices))))
(defun hc-use-hc-lsp-rust ()
"DRY."
(message "Using hc-lsp-rust")
(use-package hc-lsp-rust)
(setq hc-rust-pick 'hc-lsp-rust))
(let ((pick (hc-pick-lsp-support)))
(cond (;; -------------------------
(equal pick "eglot")
(message "Using hc-eglot-haskell")
(use-package hc-eglot-haskell)
(setq hc-haskell-pick 'hc-eglot-haskell)
(hc-use-hc-lsp-rust) ;; TODO: eglot-rust
)
(;; -------------------------
(equal pick "lsp")
(message "Using hc-lsp-haskell")
(use-package hc-lsp-haskell)
(setq hc-haskell-pick 'hc-lsp-haskell)
(hc-use-hc-lsp-rust)
)
(;; -------------------------
(equal pick "none")
(message "NO LSP SUPPORT")
(setq hc-haskell-pick 'none)
(setq hc-rust-pick 'none)
)
(t
(message "NO LSP MATCH %s" pick))))
;;;;;;;;;;;;;
(provide 'hc-lsp-pick)
;;; hc-lsp-pick.el ends here