Next: Buffers, Projects, and Eglot, Up: Using Eglot [Contents][Index]
While Eglot is enabled in a buffer, it is said to be managing it, using LSP and the specific capabilities of the language server to activate and enhance modern IDE features in Emacs. Some of these features are provided via other Emacs packages, and some via Eglot directly (see Eglot Commands).
Here’s an overview of the main features that Eglot 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. However, See Extending Eglot.
Finally, it’s worth noting that, by default, Eglot generally turns on all features that it can turn on. It’s possible to opt out of some features via user options (see Customizing Eglot) and a hook that runs after Eglot starts managing a buffer (see Buffers, Projects, and Eglot).
Next: Buffers, Projects, and Eglot, Up: Using Eglot [Contents][Index]