@@ -396,13 +396,17 @@ Install the two Atom packages [atom-ide-ui](https://atom.io/packages/atom-ide-ui
396
396
$ apm install language-haskell atom-ide-ui haskell
397
397
` ` `
398
398
399
- # ## Emacs
399
+ # ## [ Emacs](https://www.gnu.org/software/emacs/)
400
400
401
- Emacs support is provided by a combination of the following packages :
401
+ Emacs support can be provided by different combinations of packages :
402
402
403
- [lsp-mode](https://github.com/emacs-lsp/lsp-mode)
404
- [lsp-ui](https://github.com/emacs-lsp/lsp-ui)
405
- [lsp-haskell](https://github.com/emacs-lsp/lsp-haskell)
403
+ - [eglot](https://github.com/joaotavora/eglot) (built-in from Emacs 29 onwards)
404
+
405
+ or
406
+
407
+ - [lsp-mode](https://github.com/emacs-lsp/lsp-mode),
408
+ [lsp-ui](https://github.com/emacs-lsp/lsp-ui) and
409
+ [lsp-haskell](https://github.com/emacs-lsp/lsp-haskell)
406
410
407
411
You can install these manually if you are using plain Emacs; instructions for some specific flavours
408
412
are included below.
@@ -412,6 +416,32 @@ various parts of the Emacs integration.
412
416
In particular, `lsp-haskell` provides customization options for the `haskell-language-server`-specific parts,
413
417
such as the path to the server executable.
414
418
419
+ # ### [use-package](https://github.com/jwiegley/use-package) [eglot](https://github.com/joaotavora/eglot)
420
+
421
+ If you are using vanilla emacs with `use-package`, put the following into your `~/.emacs`.
422
+ This will install `eglot` and enable it by default in `haskell-mode`.
423
+ To configure `haskell-language-server` we use the `eglot-workspace-configuration` variable.
424
+ With `M-x eglot-show-workspace-configuration` you can see the JSON that `eglot` will send to `haskell-language-server`.
425
+ See <https://joaotavora.github.io/eglot/#Customizing-Eglot> for more information.
426
+ As an example, the setting below will disable the `stan` plugin.
427
+
428
+ ` ` ` emacs-lisp
429
+ (use-package eglot
430
+ :ensure t
431
+ :config
432
+ (add-hook 'haskell-mode-hook 'eglot-ensure)
433
+ :config
434
+ (setq-default eglot-workspace-configuration
435
+ '((haskell
436
+ (plugin
437
+ (stan
438
+ (globalOn . :json-false)))))) ;; disable stan
439
+ :custom
440
+ (eglot-autoshutdown t) ;; shutdown language server after closing last file
441
+ (eglot-confirm-server-initiated-edits nil) ;; allow edits without confirmation
442
+ )
443
+ ` ` `
444
+
415
445
# ### [doom-emacs](https://github.com/hlissner/doom-emacs/tree/develop/modules/lang/haskell#module-flags)
416
446
417
447
Manual installation of packages is not required.
0 commit comments