diff options
| author | João Távora | 2024-10-09 06:26:27 -0500 |
|---|---|---|
| committer | João Távora | 2024-10-09 06:26:27 -0500 |
| commit | cd36e070c24d7828ea1b9bf62ffa920068ac4d41 (patch) | |
| tree | e5bd0fd476669b453f840f8364d0c958ffed6107 | |
| parent | 1ea0d9b891bf7abadd291aeb715c51c4cc496dba (diff) | |
| download | emacs-cd36e070c24d7828ea1b9bf62ffa920068ac4d41.tar.gz emacs-cd36e070c24d7828ea1b9bf62ffa920068ac4d41.zip | |
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.
| -rw-r--r-- | doc/misc/eglot.texi | 28 | ||||
| -rw-r--r-- | lisp/progmodes/eglot.el | 9 |
2 files changed, 23 insertions, 14 deletions
diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index fb5b618bd84..959bbfa6857 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi | |||
| @@ -123,14 +123,16 @@ Here's how to start using Eglot with your programming project: | |||
| 123 | @item | 123 | @item |
| 124 | Select and install a language server. | 124 | Select and install a language server. |
| 125 | 125 | ||
| 126 | Eglot comes pre-configured with many popular language servers, see the | 126 | Eglot comes pre-configured for many popular language servers, see the |
| 127 | value of @code{eglot-server-programs}. If the server(s) mentioned | 127 | value of @code{eglot-server-programs}. If the server(s) mentioned there |
| 128 | there satisfy your needs for the programming language(s) with which | 128 | satisfy your needs for the programming language(s) with which you want |
| 129 | you want to use Eglot, you just need to make sure those servers are | 129 | to use Eglot, you just need to make sure those servers are installed on |
| 130 | installed on your system. Alternatively, install one or more servers | 130 | your system and Eglot can find them. |
| 131 | of your choice and add them to the value of | 131 | |
| 132 | Alternatively, install one or more servers of your choice and tell Eglot | ||
| 133 | where to find them. To do that, you may add to the value of | ||
| 132 | @code{eglot-server-programs}, as described in @ref{Setting Up LSP | 134 | @code{eglot-server-programs}, as described in @ref{Setting Up LSP |
| 133 | Servers}. | 135 | Servers} or have Eglot prompt you about it (@pxref{Eglot Commands}). |
| 134 | 136 | ||
| 135 | @item | 137 | @item |
| 136 | Turn on Eglot for your project. | 138 | Turn on Eglot for your project. |
| @@ -197,7 +199,7 @@ particular server(s) you want to install. | |||
| 197 | 199 | ||
| 198 | To use a language server, Eglot must know how to start it and which | 200 | To use a language server, Eglot must know how to start it and which |
| 199 | programming languages each server supports. This information is | 201 | programming languages each server supports. This information is |
| 200 | provided by the variable @code{eglot-server-programs}. | 202 | commonly provided by the variable @code{eglot-server-programs}. |
| 201 | 203 | ||
| 202 | @defvar eglot-server-programs | 204 | @defvar eglot-server-programs |
| 203 | This variable associates major modes with names and command-line | 205 | This variable associates major modes with names and command-line |
| @@ -939,12 +941,16 @@ to @w{@code{(disallow-non-standard-keys enforce-required-keys)}}. | |||
| 939 | 941 | ||
| 940 | @vindex eglot-server-initialized-hook | 942 | @vindex eglot-server-initialized-hook |
| 941 | @item eglot-server-initialized-hook | 943 | @item eglot-server-initialized-hook |
| 942 | A hook run after the server object is successfully initialized. | 944 | A hook run after the server object is successfully initialized (which |
| 945 | includes launching the process) but before any LSP communication is | ||
| 946 | attempted. Each function receives a @code{eglot-lsp-server} instance as | ||
| 947 | argument. | ||
| 943 | 948 | ||
| 944 | @vindex eglot-connect-hook | 949 | @vindex eglot-connect-hook |
| 945 | @item eglot-connect-hook | 950 | @item eglot-connect-hook |
| 946 | A hook run after connection to the server is successfully | 951 | A hook run after the LSP connection to the server is successfully |
| 947 | established. @xref{Starting Eglot}. | 952 | established. Each function receives a @code{eglot-lsp-server} instance |
| 953 | as argument. @xref{Starting Eglot}. | ||
| 948 | 954 | ||
| 949 | @item eglot-managed-mode-hook | 955 | @item eglot-managed-mode-hook |
| 950 | A hook run after Eglot started or stopped managing a buffer. | 956 | A hook run after Eglot started or stopped managing a buffer. |
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 58487924883..e7a0a3ce135 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el | |||
| @@ -1487,18 +1487,21 @@ Use current server's or first available Eglot events buffer." | |||
| 1487 | 1487 | ||
| 1488 | (defvar eglot-connect-hook | 1488 | (defvar eglot-connect-hook |
| 1489 | '(eglot-signal-didChangeConfiguration) | 1489 | '(eglot-signal-didChangeConfiguration) |
| 1490 | "Hook run after connecting in `eglot--connect'.") | 1490 | "Hook run after connecting to a server. |
| 1491 | Each function is passed an `eglot-lsp-server' instance | ||
| 1492 | as argument.") | ||
| 1491 | 1493 | ||
| 1492 | (defvar eglot-server-initialized-hook | 1494 | (defvar eglot-server-initialized-hook |
| 1493 | '() | 1495 | '() |
| 1494 | "Hook run after a `eglot-lsp-server' instance is created. | 1496 | "Hook run after a `eglot-lsp-server' instance is created. |
| 1495 | 1497 | ||
| 1496 | That is before a connection was established. Use | 1498 | That is before a connection is established. Use |
| 1497 | `eglot-connect-hook' to hook into when a connection was | 1499 | `eglot-connect-hook' to hook into when a connection was |
| 1498 | successfully established and the server on the other side has | 1500 | successfully established and the server on the other side has |
| 1499 | received the initializing configuration. | 1501 | received the initializing configuration. |
| 1500 | 1502 | ||
| 1501 | Each function is passed the server as an argument") | 1503 | Each function is passed an `eglot-lsp-server' instance |
| 1504 | as argument.") | ||
| 1502 | 1505 | ||
| 1503 | (defun eglot--cmd (contact) | 1506 | (defun eglot--cmd (contact) |
| 1504 | "Helper for `eglot--connect'." | 1507 | "Helper for `eglot--connect'." |