|
78 | 78 | :prefix "eglot-"
|
79 | 79 | :group 'applications)
|
80 | 80 |
|
| 81 | +(defconst eglot-custom-format-doc "%t: %v%h" |
| 82 | + "Custom type format for widget with expandable inline documentation.") |
| 83 | + |
| 84 | +(defconst eglot-custom-format-button-doc "%[%t%] %v%h" |
| 85 | + "Custom type format for button widget with expandable inline documentation.") |
| 86 | + |
81 | 87 | (defconst eglot-server-programs-contact
|
82 |
| - '((cons :tag "Standard I/O" |
| 88 | + `((cons :format ,eglot-custom-format-doc |
| 89 | + :tag "Standard I/O" |
| 90 | + :doc "PROGRAM is called with ARGS and is expected to serve LSP requests over the standard input/output channels." |
83 | 91 | (string :tag "Program")
|
84 | 92 | (repeat :tag "Arguments" string))
|
85 |
| - (list :tag "TCP Connection" |
86 |
| - (string :tag "Host") |
87 |
| - (number :tag "Port") |
88 |
| - (list :tag "TCP Arguments" |
89 |
| - :inline t |
90 |
| - string |
91 |
| - (choice (const nil) |
92 |
| - string) |
93 |
| - string |
94 |
| - (choice string |
95 |
| - number) |
96 |
| - (plist :key-type symbol))) |
97 |
| - (cons :tag "TCP Auto-connect" |
| 93 | + (list :format ,eglot-custom-format-doc |
| 94 | + :tag "TCP Connection" |
| 95 | + :doc "For connecting to a server via TCP." |
| 96 | + (string :format ,eglot-custom-format-doc |
| 97 | + :tag "Host" |
| 98 | + :doc "Name or IP address.") |
| 99 | + (number :tag "TCP Port") |
| 100 | + (plist :format ,eglot-custom-format-doc |
| 101 | + :tag "TCP Parameters" |
| 102 | + :doc "Passed to `open-network-stream' for upgrading the connection with encryption or other capabilities. |
| 103 | +Sequence of keywords and values: consult `open-network-stream' PARAMETERS documentation." |
| 104 | + :key-type (symbol :tag "Keyword"))) |
| 105 | + (cons :format ,eglot-custom-format-doc |
| 106 | + :tag "TCP Auto-Launch" |
| 107 | + :doc "A combination of TCP Connection and program launch. |
| 108 | +First, an attempt is made to find an available server port, then |
| 109 | +PROGRAM is launched with ARGS; the `:autoport' keyword substituted for |
| 110 | +that number; and MOREARGS. Eglot then attempts to to establish a TCP |
| 111 | +connection to that port number on the localhost." |
98 | 112 | (string :tag "Program")
|
99 | 113 | (list (repeat :tag "Arguments"
|
100 | 114 | :inline t
|
@@ -173,12 +187,29 @@ of those modes. CONTACT can be:
|
173 | 187 | :value-type (choice :tag "Contact"
|
174 | 188 | ,@eglot-server-programs-contact
|
175 | 189 | (cons :tag "Experimental LSP"
|
176 |
| - (symbol :tag "Class Name") |
177 |
| - (choice :tag "Initialization" |
178 |
| - (plist :tag "Class Initializer" |
| 190 | + (symbol :format ,eglot-custom-format-doc |
| 191 | + :tag "Class Name" |
| 192 | + :doc "A symbol designating a subclass of `eglot-lsp-server', for representing experimental LSP servers.") |
| 193 | + (choice :format ,eglot-custom-format-button-doc |
| 194 | + :tag "Initialization" |
| 195 | + :doc "A plist of CLASS-NAME initialization parameters, or a CONTACT form, which is converted to a suitable :PROCESS initialization parameter for CLASS-NAME. |
| 196 | +The class `eglot-lsp-server' descends `jsonrpc-process-connection', |
| 197 | +which you should see for the semantics of the mandatory :PROCESS |
| 198 | +argument." |
| 199 | + (plist :format ,eglot-custom-format-doc |
| 200 | + :tag "Class Initializer" |
| 201 | + :doc "A keyword-value plist used to initialize CLASS-NAME." |
179 | 202 | :key-type symbol)
|
180 | 203 | ,@eglot-server-programs-contact))
|
181 |
| - (function :tag "Contact Generator")))) |
| 204 | + (function :format ,eglot-custom-format-doc |
| 205 | + :tag "Contact Generator" |
| 206 | + :doc "A function of a single argument producing any of the other values for CONTACT. |
| 207 | +The argument's value is non-nil if the connection was requested |
| 208 | +interactively (e.g. from the `eglot' command), and nil if it wasn't |
| 209 | +(e.g. from `eglot-ensure'). If the call is interactive, the function |
| 210 | +can ask the user for hints on finding the required programs, etc. |
| 211 | +Otherwise, it should not ask the user for any input, and return nil or |
| 212 | +signal an error if it can't produce a valid CONTACT.")))) |
182 | 213 |
|
183 | 214 | (defface eglot-mode-line
|
184 | 215 | '((t (:inherit font-lock-constant-face :weight bold)))
|
|
0 commit comments