Skip to content

Commit c67ac42

Browse files
committed
Add lsp-haskell-plugins config, for coming HLS feature
This is a first stab at support for haskell/haskell-language-server#691 We will probably have to have a big switch here too, to not send the new config unless we know hls supports it. How? Provides context for emacs-lsp#99
1 parent 592e883 commit c67ac42

File tree

1 file changed

+95
-7
lines changed

1 file changed

+95
-7
lines changed

lsp-haskell.el

+95-7
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,88 @@
7474
:group 'lsp-haskell
7575
:type 'boolean)
7676
(defcustom lsp-haskell-formatting-provider
77-
"ormolu"
77+
"ormolu"
7878
"The formatter to use when formatting a document or range."
7979
:group 'lsp-haskell
80-
:type '(choice (const :tag "brittany" "brittany")
81-
(const :tag "floskell" "floskell")
82-
(const :tag "fourmolu" "fourmolu")
83-
(const :tag "ormolu" "ormolu")
84-
(const :tag "stylish-haskell" "stylish-haskell")
80+
:type '(choice (const :tag "brittany" "brittany")
81+
(const :tag "floskell" "floskell")
82+
(const :tag "fourmolu" "fourmolu")
83+
(const :tag "ormolu" "ormolu")
84+
(const :tag "stylish-haskell" "stylish-haskell")
8585
(const :tag "none" "none")))
8686

87+
;; ---------------------------------------------------------------------
88+
;; Plugin-specific configuration
89+
(defgroup lsp-haskell-plugins nil
90+
"Customization group for 'lsp-haskell' plugins."
91+
:group 'lsp-haskell)
92+
93+
(defcustom lsp-haskell-ghcide-on
94+
t
95+
"Turn on the ghcide plugins."
96+
:group 'lsp-haskell-plugins
97+
:type 'boolean)
98+
(defcustom lsp-haskell-pragmas-on
99+
t
100+
"Turn on the pragmas plugin."
101+
:group 'lsp-haskell-plugins
102+
:type 'boolean)
103+
(defcustom lsp-haskell-floskell-on
104+
t
105+
"Turn on the floskell plugin."
106+
:group 'lsp-haskell-plugins
107+
:type 'boolean)
108+
(defcustom lsp-haskell-fourmolu-on
109+
t
110+
"Turn on the fourmolu plugin."
111+
:group 'lsp-haskell-plugins
112+
:type 'boolean)
113+
(defcustom lsp-haskell-ormolu-on
114+
t
115+
"Turn on the ormolu plugin."
116+
:group 'lsp-haskell-plugins
117+
:type 'boolean)
118+
(defcustom lsp-haskell-stylish-haskell-on
119+
t
120+
"Turn on the stylish-haskell plugin."
121+
:group 'lsp-haskell-plugins
122+
:type 'boolean)
123+
(defcustom lsp-haskell-brittany-on
124+
t
125+
"Turn on the brittany plugin."
126+
:group 'lsp-haskell-plugins
127+
:type 'boolean)
128+
(defcustom lsp-haskell-tactic-on
129+
t
130+
"Turn on the tactic plugin."
131+
:group 'lsp-haskell-plugins
132+
:type 'boolean)
133+
(defcustom lsp-haskell-retrie-on
134+
t
135+
"Turn on the retrie plugin."
136+
:group 'lsp-haskell-plugins
137+
:type 'boolean)
138+
(defcustom lsp-haskell-eval-on
139+
t
140+
"Turn on the eval plugin."
141+
:group 'lsp-haskell-plugins
142+
:type 'boolean)
143+
(defcustom lsp-haskell-importlens-on
144+
t
145+
"Turn on the explicit import lens."
146+
:group 'lsp-haskell-plugins
147+
:type 'boolean)
148+
(defcustom lsp-haskell-modulename-on
149+
t
150+
"Turn on the moduleName plugin."
151+
:group 'lsp-haskell-plugins
152+
:type 'boolean)
153+
(defcustom lsp-haskell-hlint-on
154+
t
155+
"Turn on the hlint plugin."
156+
:group 'lsp-haskell-plugins
157+
:type 'boolean)
158+
87159
;; ---------------------------------------------------------------------
88160
;; Non-language server options
89161

@@ -238,7 +310,23 @@ and `lsp-haskell-server-args' and `lsp-haskell-server-wrapper-function'."
238310
("haskell.liquidOn" lsp-haskell-liquid-on t)
239311
("haskell.diagnosticsOnChange" lsp-haskell-diagnostics-on-change t)
240312
("haskell.maxNumberOfProblems" lsp-haskell-max-number-of-problems)
241-
("haskell.hlintOn" lsp-haskell-hlint-on t)))
313+
("haskell.hlintOn" lsp-haskell-hlint-on t)
314+
315+
("haskell.plugin.ghcide.globalOn" lsp-haskell-ghcide-on t)
316+
("haskell.plugin.pragmas.globalOn" lsp-haskell-pragmas-on t)
317+
("haskell.plugin.floskell.globalOn" lsp-haskell-floskell-on t)
318+
("haskell.plugin.fourmolu.globalOn" lsp-haskell-fourmolu-on t)
319+
("haskell.plugin.ormolu.globalOn" lsp-haskell-ormolu-on t)
320+
("haskell.plugin.stylish-haskell.globalOn" lsp-haskell-stylish-haskell-on t)
321+
("haskell.plugin.brittany.globalOn" lsp-haskell-brittany-on t)
322+
("haskell.plugin.tactic.globalOn" lsp-haskell-tactic-on t)
323+
("haskell.plugin.retrie.globalOn" lsp-haskell-retrie-on t)
324+
("haskell.plugin.eval.globalOn" lsp-haskell-eval-on t)
325+
("haskell.plugin.importLens.globalOn" lsp-haskell-importlens-on t)
326+
("haskell.plugin.moduleName.globalOn" lsp-haskell-modulename-on t)
327+
("haskell.plugin.hlint.globalOn" lsp-haskell-hlint-on t)
328+
329+
))
242330

243331
;; This mapping is set for 'haskell-mode -> haskell' in the lsp-mode repo itself. If we move
244332
;; it there, then delete it from here.

0 commit comments

Comments
 (0)