@@ -233,20 +233,29 @@ and `lsp-haskell-server-args'."
233233 (" haskell.maxNumberOfProblems" lsp-haskell-max-number-of-problems)
234234 (" haskell.hlintOn" lsp-haskell-hlint-on t )))
235235
236+ ; ; This mapping is set for 'haskell-mode -> haskell' in the lsp-mode repo itself. If we move
237+ ; ; it there, then delete it from here.
238+ ; ; It also isn't *too* important: it only sets the language ID, see
239+ ; ; https://microsoft.github.io/language-server-protocol/specification#textDocumentItem
240+ (add-to-list 'lsp-language-id-configuration '(haskell-literate-mode . " haskell" ))
241+
236242; ; Register the client itself
237243(lsp-register-client
238244 (make-lsp--client
239245 :new-connection (lsp-stdio-connection (lambda () (lsp-haskell--server-command)))
240- :major-modes '(haskell-mode )
246+ ; ; Should run under haskell-mode and haskell-literate-mode. We need to list the
247+ ; ; latter even though it's a derived mode of the former
248+ :major-modes '(haskell-mode haskell-literate-mode)
241249 ; ; This is arbitrary.
242250 :server-id 'lsp-haskell
243251 ; ; We need to manually pull out the configuration section and set it. Possibly in
244252 ; ; the future lsp-mode will asssociate servers with configuration sections more directly.
245253 :initialized-fn (lambda (workspace )
246254 (with-lsp-workspace workspace
247255 (lsp--set-configuration (lsp-configuration-section " haskell" ))))
248- ; ; No need to set :language-id, since there isn't one for Haskell and we
249- ; ; don't support multiple languages
256+ ; ; This is somewhat irrelevant, but it is listed in lsp-language-id-configuration, so
257+ ; ; we should set something consistent here.
258+ :language-id " haskell"
250259 ))
251260
252261; ; ---------------------------------------------------------------------
0 commit comments