Skip to content

Commit bd58606

Browse files
Document how to set formattingProvider in emacs, modern syntax (#4713)
eglot docs recommend using property lists Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 5550ca5 commit bd58606

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

docs/configuration.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -443,22 +443,20 @@ This will install `eglot` and enable it by default in `haskell-mode`.
443443
To configure `haskell-language-server` we use the `eglot-workspace-configuration` variable.
444444
With `M-x eglot-show-workspace-configuration` you can see the JSON that `eglot` will send to `haskell-language-server`.
445445
See <https://joaotavora.github.io/eglot/#Customizing-Eglot> for more information.
446-
As an example, the setting below will disable the `stan` plugin.
446+
As an example, the setting below will disable the `stan` plugin and use `fourmolu` for formatting:
447447

448448
```emacs-lisp
449449
(use-package eglot
450450
:ensure t
451451
:config
452-
(add-hook 'haskell-mode-hook 'eglot-ensure)
452+
(add-hook 'haskell-mode-hook 'eglot-ensure) ; start eglot automatically in haskell projects
453453
:config
454454
(setq-default eglot-workspace-configuration
455-
'((haskell
456-
(plugin
457-
(stan
458-
(globalOn . :json-false)))))) ;; disable stan
455+
'(:haskell (:plugin (:stan (:globalOn :json-false)) ; disable stan
456+
:formattingProvider "fourmolu"))) ; use fourmolu instead of ormolu
459457
:custom
460-
(eglot-autoshutdown t) ;; shutdown language server after closing last file
461-
(eglot-confirm-server-initiated-edits nil) ;; allow edits without confirmation
458+
(eglot-autoshutdown t) ; shutdown language server after closing last file
459+
(eglot-confirm-server-initiated-edits nil) ; allow edits without confirmation
462460
)
463461
```
464462

0 commit comments

Comments
 (0)