Skip to content

LSP Support

USAMI Kenta edited this page Oct 20, 2022 · 5 revisions

LSP is a protocol for providing language-specific development support functions by intercommunicating with another process.

Language Servers

There are several Language Servers for PHP. In order for you to add IDE-like functionality to PHP Mode, you must install any Language Server.

Phpactor

Phpactor is a free software, Language Server that runs on PHP 7.4+.

Intelephense

Intelephense is released as an extension of VS Code, but is available as a Language Server. It's peculiar that this server runs on the Node.js runtime instead of PHP. This is available without payment, but please be aware that it is not free (libre) software. The EULA restricts you from modifying or reverse engineering this software.

LSP Clients

There are two known LSP Clients in Emacs. They have different characteristics. LSP Mode is generally more powerful and easier to set up.

Eglot

Eglot has a simpler implementation compared to LSP Mode, but integrates with popular completion frameworks like Company. Eglot has been merged into GNU Emacs 29 as the built-in LSP client, but is provided with online updates in GNU ELPA.

This strange name is a portmanteau word of Emacs + Polyglot.

LSP Mode

LSP Mode is a feature-rich LSP Client. It also has bundled integration with Language Servers like Intelephense by default. LSP-UI provides a rich IDE-like interface for GUI Emacs.

Clone this wiki locally