-
Notifications
You must be signed in to change notification settings - Fork 389
Changelog: Announce ocaml-eglot #3080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d399d1e
draft of a post on ocaml-eglot under ocaml-lsp
sabine dba5aa8
add notes
sabine 8301eac
link to 1.1.0 release
sabine bec36eb
Update 2025-04-29-ocaml-eglot-brings-lsp-support-to-emacs.md
sabine 256bb4e
Draft post
sabine e98ec7c
Update 2025-04-29-ocaml-eglot-brings-lsp-support-to-emacs.md
sabine 7306165
rename file to prospective date of publication
sabine 8f21347
editing based on xvw feedback
sabine d869828
minor formatting
sabine b46c940
remove essential commands because we don't have tables on ocaml.org, …
sabine 19aedf2
revised
sabine a51349c
last edit
sabine dcb9e80
be more clear on maintenance status
sabine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
...changelog/posts/ocaml-lsp/2025-08-26-ocaml-eglot-brings-lsp-support-to-emacs.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| --- | ||
| title: "Emacs Integration for OCaml LSP Server: Introducing ocaml-eglot" | ||
| tags: [ocaml-lsp, platform] | ||
| --- | ||
|
|
||
| # Emacs Integration for OCaml LSP Server: Introducing ocaml-eglot | ||
|
|
||
| ## TL;DR | ||
|
|
||
| `ocaml-eglot` provides full OCaml language support in Emacs through the Language Server Protocol (LSP) instead of direct Merlin integration. It offers the same features as `merlin.el` with simplified setup and enhanced capabilities like project-wide search. If you're starting fresh or want a more standardized approach, try `ocaml-eglot`, which is actively maintained. If your current `merlin.el` setup works well, you can continue using it. | ||
|
|
||
| **Quick start**: [Install `ocaml-lsp-server`, add `ocaml-eglot` to your Emacs config](https://github.com/tarides/ocaml-eglot?tab=readme-ov-file#installation), and get the same OCaml development experience with less configuration. | ||
|
|
||
| ## What is ocaml-eglot? | ||
|
|
||
| `ocaml-eglot` connects Emacs to `ocaml-lsp-server` using the Language Server Protocol, providing a standardized way to get OCaml language support. | ||
|
|
||
| Since the recent versions of Emacs (29), `eglot`, an LSP client, has been shipped with Emacs. However, `merlin.el` provides more features than LSP (which is designed to be generic), so relying solely on the features of LSP and `eglot` would limit functionality. Thus, we extended the LSP server to support more features, and `ocaml-eglot` allows you to benefit from these features in Emacs. | ||
|
|
||
| `ocaml-eglot` is a minor mode. It therefore works in conjunction with a major mode to edit Caml code. Examples of major modes include `tuareg`, `caml-mode` and the recent `neocaml`. | ||
|
|
||
| ## Who Should Use ocaml-eglot? | ||
|
|
||
| **Use ocaml-eglot if you:** | ||
| - Are starting fresh with OCaml | ||
| - If you use or want to use Emacs | ||
| - Want simplified configuration with automatic setup | ||
| - Use multiple editors and want consistent OCaml support | ||
| - Want access to project-wide search and rename features | ||
| - Want to rely on an actively maintained project that evolves over time | ||
|
|
||
| **Stick with `merlin.el` if:** | ||
| - Your current setup is working perfectly and heavily customized | ||
| - You prefer direct Merlin communication | ||
|
sabine marked this conversation as resolved.
Outdated
|
||
|
|
||
| For the moment, we don't plan to provide any special support for `merlin.el` -- unless we receive a lot of requests. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| Follow the [installation instructions in the ocaml-eglot README](https://github.com/tarides/ocaml-eglot?tab=readme-ov-file#installation). | ||
|
|
||
| When migrating from `merlin.el` to `ocaml-eglot`, your existing keybindings should work immediately! | ||
|
|
||
| ## Features | ||
|
|
||
| **Error Navigation:** Quick jump to next/previous errors | ||
|
|
||
| **Type Information:** Display types under cursor with adjustable verbosity, navigate enclosing expressions | ||
|
|
||
| **Code Generation:** Pattern matching construction, case completion, wildcard refinement via "destruct" feature | ||
|
|
||
| **Navigation:** Jump between language constructs (let, module, function, match), navigate phrases and pattern cases | ||
|
|
||
| **Search:** Find definitions, declarations, and references | ||
|
|
||
| For a detailed list of features, see [the ocaml-eglot README](https://github.com/tarides/ocaml-eglot?tab=readme-ov-file#features). | ||
|
|
||
| ## Next Steps | ||
|
|
||
| 1. Try the basic setup with an existing OCaml project | ||
| 2. Explore all the features of `ocaml-eglot` | ||
| 3. Provide feedback at [ocaml-eglot's GitHub Issues](https://github.com/tarides/ocaml-eglot/issues) | ||
|
|
||
| ## Documentation | ||
|
|
||
| - [ocaml-eglot README](https://github.com/tarides/ocaml-eglot) | ||
| - [OCaml.org editor setup tutorial](https://ocaml.org/docs/set-up-editor#emacs) | ||
|
|
||
| ## Related Releases | ||
|
|
||
| On January 17, 2025, [ocaml-eglot version 1.0.0 was released](https://discuss.ocaml.org/t/ann-release-of-ocaml-eglot-1-0-0/15978/14), providing a new minor emacs mode to enable the editor features provided by **ocaml-lsp-server**. Subsequent releases [1.1.0](https://github.com/tarides/ocaml-eglot/releases/tag/1.1.0) and [1.2.0](https://discuss.ocaml.org/t/ann-release-of-ocaml-eglot-1-2-0/16515) enable support for `flycheck` as a configurable alternative to `flymake` (`1.0.0` release), Emacs `30.1` support, better user experience and error handling, as well as support for new features. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.