Eglot or lsp-mode? Eglot is built into Emacs, small, and uses the editor's own tools (Flymake, xref, Eldoc, completion-at-point). lsp-mode is a larger third-party package with its own UI extensions. Here is how they compare in 2026, checked against Eglot 1.24.31 (in Emacs 31.1), lsp-mode's own documentation, and the Eglot setup I use every day for PHP.
Updated 15 November 2026. An earlier version of this comparison had several errors. It said Eglot supports several servers per buffer since Emacs 29.1, that its inlay hints come through Eldoc, that lsp-mode completes through company-lsp, and that Eglot users have no integrated debugger. All four are corrected below.
The short answer
- Start with Eglot if you're on Emacs 29 or later. There's nothing to install, and it plugs into Flymake, xref, Eldoc and whatever completion UI you already use.
- Pick lsp-mode if you want its extras:
lsp-ui's sideline and peek views, code lens, headerline breadcrumbs,M-x lsp-install-serverto download language servers for you, or Flycheck instead of Flymake. - The debugger is no longer the deciding factor. lsp-mode pairs with dap-mode, but dape is a standalone debug adapter client that needs neither package. I use it with Eglot.
What I use
Eglot, with Intelephense for PHP. This is the Eglot block from my config (config/core/ide.el), with keys borrowed from PhpStorm:
(use-package eglot
:ensure nil ; built in
:custom
(eglot-autoshutdown t)
(eglot-events-buffer-config '(:size 0 :format full)) ; logging slows big projects
(eglot-extend-to-xref t) ; stay connected when jumping into vendor/
:bind (:map eglot-mode-map
("M-RET" . eglot-code-actions)
("S-<f6>" . eglot-rename)
("C-c l f" . eglot-format-buffer)
("C-c l i" . eglot-find-implementation)
("C-c l t" . eglot-find-typeDefinition)
("C-c l d" . consult-flymake)
("C-c l s" . consult-eglot-symbols)
("C-c l R" . eglot-reconnect)))eglot-autoshutdown tstops a server when the last buffer it manages is killed. The default isnil.eglot-events-buffer-configwith:size 0turns off the JSON-RPC event log. It replacedeglot-events-buffer-size, which Eglot now marks obsolete. Older guides, including the first version of this article, still use the old name.eglot-extend-to-xref t: per its docstring, "activate Eglot in cross-referenced non-project files", such as a library outside the project root that you reach withM-.. The default isnil. My comment saysvendor/, but avendor/directory inside the repository already belongs to the project, so this option matters for files outside it.consult-eglot-symbolscomes from the separate consult-eglot package. Everything else is Eglot's own.
The Intelephense side, including initializationOptions, Drupal file types and the project's PHP version, is covered in Configuring Intelephense in Eglot. Running PHPUnit and PHPStan inside DDEV from Emacs is in a separate article.
Feature comparison
| Feature | Eglot | lsp-mode |
|---|---|---|
| Installation | Built in since Emacs 29.1 | Package from MELPA |
| Diagnostics | Flymake | Flymake or Flycheck (Flycheck picked up automatically if installed) |
| Completion | completion-at-point (Corfu, Company's company-capf, …) | completion-at-point. company-lsp is no longer supported (lsp-mode changelog) |
| Hover docs | Eldoc | Eldoc, or lsp-ui's doc pop-ups |
| Find definition / references | xref | xref, plus lsp-ui peek and lsp-treemacs views |
| Rename / code actions / format | eglot-rename, eglot-code-actions, eglot-format-buffer | lsp-rename, lsp-execute-code-action, lsp-format-buffer |
| Inlay hints | eglot-inlay-hints-mode (a minor mode, drawn as overlays) | lsp-inlay-hints-mode |
| Several servers in one buffer | One server process per buffer. Since Eglot 1.20 (January 2026) you can combine servers through a multiplexer such as rass | Supported directly |
| Installing servers | You install them yourself | M-x lsp-install-server |
| Debugging | Any DAP client, for example dape | dap-mode (same project family), or dape |
| Extras | Kept deliberately small (about 5,900 lines in Emacs 31.1) | Code lens, headerline breadcrumb, lsp-ui sideline, Helm/Ivy/Consult/Treemacs integrations |
The Eglot rows come from Eglot's manual (M-x eglot-manual) and its NEWS file (etc/EGLOT-NEWS). The lsp-mode rows come from its README, installation guide and changelog on GitHub.
Several servers in one buffer
This is the one real architectural difference, and it's often stated wrongly. Eglot's manual says it "still communicates with a single LSP server process in each buffer". Several servers in one project (a PHP server for .php files, another for .js) has always worked, because each file gets its own server.
What's new since Eglot 1.20 is support for multiplexers: a program like Rassumfrassum (rass) sits between Eglot and several real servers and presents them as one. The manual's examples include a spell-checking server next to the language server, ty plus ruff for Python, and Vue files with embedded JavaScript, CSS and HTML. If that's your main need, lsp-mode does it without a middleman.
Debugging without lsp-mode
The old argument was "if you want an integrated debugger, you need lsp-mode and dap-mode". That's no longer true. dape describes itself as "a debug adapter client for Emacs". Its only declared requirements are Emacs 29.1 and jsonrpc, so it works alongside Eglot, lsp-mode or neither. My setup, with PhpStorm's keys:
(use-package dape
:ensure t
:demand t
:custom
(dape-buffer-window-arrangement 'right)
(dape-inlay-hints t)
:config
(dape-breakpoint-global-mode 1) ; click the fringe to set breakpoints
:bind (("C-<f8>" . dape-breakpoint-toggle)
("<f7>" . dape-step-in)
("<f8>" . dape-next)
("S-<f8>" . dape-step-out)
("<f9>" . dape-continue)
("C-<f2>" . dape-quit)))For PHP you also need Xdebug on the server side. The Docker and nginx part is in the Xdebug 3 setup article.
Performance
I haven't benchmarked the two clients against each other, so there are no timing figures here. The earlier version of this article had some, without a source. Two things are documented:
- lsp-mode's own performance guide recommends raising
gc-cons-thresholdandread-process-output-max(it suggests(* 1024 1024)), and compiling it withlsp-use-plists. That guide is written for lsp-mode. I haven't measured whether the same settings change anything for Eglot. - Eglot 1.20's NEWS reports "dramatically faster handling of files with many diagnostics". Before that, a file with thousands of diagnostics was hard to edit.
If Eglot feels slow on a big project, the event log is the first suspect. That's why my config sets :size 0.
Leave a comment
Comments are reviewed before they appear.