Eglot: minor changes to doc and docstrings
* doc/misc/eglot.texi (Quick Start): Tweak. (Setting Up LSP Servers): Tweak. (Customizing Eglot): Clarify eglot-connect-hook and eglot-initialized-hook. * lisp/progmodes/eglot.el (eglot-connect-hook) (eglot-server-initialized-hook): Rework docstring.
This commit is contained in:
parent
1ea0d9b891
commit
cd36e070c2
2 changed files with 23 additions and 14 deletions
|
@ -123,14 +123,16 @@ Here's how to start using Eglot with your programming project:
|
||||||
@item
|
@item
|
||||||
Select and install a language server.
|
Select and install a language server.
|
||||||
|
|
||||||
Eglot comes pre-configured with many popular language servers, see the
|
Eglot comes pre-configured for many popular language servers, see the
|
||||||
value of @code{eglot-server-programs}. If the server(s) mentioned
|
value of @code{eglot-server-programs}. If the server(s) mentioned there
|
||||||
there satisfy your needs for the programming language(s) with which
|
satisfy your needs for the programming language(s) with which you want
|
||||||
you want to use Eglot, you just need to make sure those servers are
|
to use Eglot, you just need to make sure those servers are installed on
|
||||||
installed on your system. Alternatively, install one or more servers
|
your system and Eglot can find them.
|
||||||
of your choice and add them to the value of
|
|
||||||
|
Alternatively, install one or more servers of your choice and tell Eglot
|
||||||
|
where to find them. To do that, you may add to the value of
|
||||||
@code{eglot-server-programs}, as described in @ref{Setting Up LSP
|
@code{eglot-server-programs}, as described in @ref{Setting Up LSP
|
||||||
Servers}.
|
Servers} or have Eglot prompt you about it (@pxref{Eglot Commands}).
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Turn on Eglot for your project.
|
Turn on Eglot for your project.
|
||||||
|
@ -197,7 +199,7 @@ particular server(s) you want to install.
|
||||||
|
|
||||||
To use a language server, Eglot must know how to start it and which
|
To use a language server, Eglot must know how to start it and which
|
||||||
programming languages each server supports. This information is
|
programming languages each server supports. This information is
|
||||||
provided by the variable @code{eglot-server-programs}.
|
commonly provided by the variable @code{eglot-server-programs}.
|
||||||
|
|
||||||
@defvar eglot-server-programs
|
@defvar eglot-server-programs
|
||||||
This variable associates major modes with names and command-line
|
This variable associates major modes with names and command-line
|
||||||
|
@ -939,12 +941,16 @@ to @w{@code{(disallow-non-standard-keys enforce-required-keys)}}.
|
||||||
|
|
||||||
@vindex eglot-server-initialized-hook
|
@vindex eglot-server-initialized-hook
|
||||||
@item eglot-server-initialized-hook
|
@item eglot-server-initialized-hook
|
||||||
A hook run after the server object is successfully initialized.
|
A hook run after the server object is successfully initialized (which
|
||||||
|
includes launching the process) but before any LSP communication is
|
||||||
|
attempted. Each function receives a @code{eglot-lsp-server} instance as
|
||||||
|
argument.
|
||||||
|
|
||||||
@vindex eglot-connect-hook
|
@vindex eglot-connect-hook
|
||||||
@item eglot-connect-hook
|
@item eglot-connect-hook
|
||||||
A hook run after connection to the server is successfully
|
A hook run after the LSP connection to the server is successfully
|
||||||
established. @xref{Starting Eglot}.
|
established. Each function receives a @code{eglot-lsp-server} instance
|
||||||
|
as argument. @xref{Starting Eglot}.
|
||||||
|
|
||||||
@item eglot-managed-mode-hook
|
@item eglot-managed-mode-hook
|
||||||
A hook run after Eglot started or stopped managing a buffer.
|
A hook run after Eglot started or stopped managing a buffer.
|
||||||
|
|
|
@ -1487,18 +1487,21 @@ Use current server's or first available Eglot events buffer."
|
||||||
|
|
||||||
(defvar eglot-connect-hook
|
(defvar eglot-connect-hook
|
||||||
'(eglot-signal-didChangeConfiguration)
|
'(eglot-signal-didChangeConfiguration)
|
||||||
"Hook run after connecting in `eglot--connect'.")
|
"Hook run after connecting to a server.
|
||||||
|
Each function is passed an `eglot-lsp-server' instance
|
||||||
|
as argument.")
|
||||||
|
|
||||||
(defvar eglot-server-initialized-hook
|
(defvar eglot-server-initialized-hook
|
||||||
'()
|
'()
|
||||||
"Hook run after a `eglot-lsp-server' instance is created.
|
"Hook run after a `eglot-lsp-server' instance is created.
|
||||||
|
|
||||||
That is before a connection was established. Use
|
That is before a connection is established. Use
|
||||||
`eglot-connect-hook' to hook into when a connection was
|
`eglot-connect-hook' to hook into when a connection was
|
||||||
successfully established and the server on the other side has
|
successfully established and the server on the other side has
|
||||||
received the initializing configuration.
|
received the initializing configuration.
|
||||||
|
|
||||||
Each function is passed the server as an argument")
|
Each function is passed an `eglot-lsp-server' instance
|
||||||
|
as argument.")
|
||||||
|
|
||||||
(defun eglot--cmd (contact)
|
(defun eglot--cmd (contact)
|
||||||
"Helper for `eglot--connect'."
|
"Helper for `eglot--connect'."
|
||||||
|
|
Loading…
Add table
Reference in a new issue