Once Eglot is enabled in a buffer, it uses LSP and the language-server capabilities to activate, enable, and enhance modern IDE features in Emacs. The features themselves are usually provided via other Emacs packages. Here’s the list of the main features that Eglot enables and provides:
etags
backend.
imenu-create-index-function
, which generates the
index for the buffer based on language-server program source analysis.
completion-at-point
command (see Symbol Completion in GNU Emacs Manual). This uses the language-server’s parser data for
the completion candidates.
eglot-format
command does (see below), but is
activated automatically as you type.
company-mode
, a popular
third-party completion package (or any other completion package), is
installed, Eglot enhances it by providing completion candidates based
on the language-server analysis of the source code.
(company-mode
can be installed from GNU ELPA.)
yasnippet
, a popular third-party package for automatic
insertion of code templates (snippets), is installed, and the language
server supports snippet completion candidates, Eglot arranges for the
completion package to instantiate these snippets using
yasnippet
. (yasnippet
can be installed from GNU ELPA.)
markdown-mode
is installed,
and the server provides at-point documentation formatted as Markdown
in addition to plain text, Eglot arranges for the ElDoc package to
enrich this text with fontifications and other nice formatting before
displaying it to the user. This makes the documentation shown by
ElDoc look nicer on display.
Not all servers support the full set of LSP capabilities, but most of them support enough to enable the basic set of features mentioned above. Conversely, some servers offer capabilities for which no equivalent Emacs package exists yet, and so Eglot cannot (yet) expose these capabilities to Emacs users.