Skip to content

Commit dd8899f

Browse files
committed
Fix prelude-ocaml: hook into neocaml-base-mode, enable LSP properly
Three issues: - Hooked into neocaml-mode instead of neocaml-base-mode, so .mli files didn't get the configuration. - Called ocaml-eglot-setup (just registers hooks) instead of enabling the ocaml-eglot minor mode (keybindings + hooks). - Never called prelude-lsp-enable, so the LSP server was not started.
1 parent 0ce9778 commit dd8899f

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

modules/prelude-ocaml.el

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,19 @@
3939
;; CamelCase aware editing operations
4040
(subword-mode +1)
4141
(when (eq prelude-lsp-client 'eglot)
42-
(require 'ocaml-eglot)
43-
;; ocaml-eglot-setup adds OCaml-specific LSP extensions (e.g.
44-
;; switch between .ml and .mli, type-enclosing, jump to holes)
45-
(ocaml-eglot-setup)))
42+
;; ocaml-eglot minor mode adds OCaml-specific LSP commands
43+
;; (switch .ml/.mli, type-enclosing, destruct, etc.)
44+
(ocaml-eglot 1))
45+
;; Start the LSP server (eglot-ensure or lsp-deferred)
46+
(prelude-lsp-enable))
4647

4748
;; Tree-sitter powered major mode for OCaml, Dune, and utop.
4849
;; Replaces the older tuareg + merlin + utop stack.
50+
;; Hook into neocaml-base-mode so both .ml and .mli buffers
51+
;; get the same setup.
4952
(use-package neocaml
5053
:ensure t
51-
:hook (neocaml-mode . prelude-ocaml-mode-defaults))
54+
:hook (neocaml-base-mode . prelude-ocaml-mode-defaults))
5255

5356
;; OCaml-specific Eglot extensions (requires ocaml-lsp-server).
5457
;; Only installed when Eglot is the configured LSP client.

0 commit comments

Comments
 (0)