[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 27fb0c6 18/54: Support serverInfo of LSP 3.15.0
From: |
João Távora |
Subject: |
[elpa] externals/eglot 27fb0c6 18/54: Support serverInfo of LSP 3.15.0 |
Date: |
Thu, 16 Apr 2020 05:31:47 -0400 (EDT) |
branch: externals/eglot
commit 27fb0c6c6738809a1e0e7ff83eda2c8e72fd929e
Author: Felicián Németh <address@hidden>
Commit: Felicián Németh <address@hidden>
Support serverInfo of LSP 3.15.0
Add support for serverInfo from the upcoming specification. This
changeset just stores the info sent by the server and slightly changes
a greeting message. But it opens up the possibility to identify
servers even when eglot uses a TCP connection and therefore makes
possible to implement server specific features (in eglot-x).
Old message:
```
Connected! Server `EGLOT (test-ccls/c++-mode)' now managing `c++-mode'
buffers in project `test-ccls'.
```
New message:
```
Connected! Server `ccls' now managing `c++-mode' buffers in project
`test-ccls'.
```
* eglot.el (eglot--lsp-interface-alist): Extend it with serverInfo.
(eglot-lsp-server): Add member variable server-info.
(eglot--connect): Store server-info and display server's name
when connected.
---
eglot.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/eglot.el b/eglot.el
index 0022737..a7b5d59 100644
--- a/eglot.el
+++ b/eglot.el
@@ -229,7 +229,7 @@ let the buffer grow forever."
(DocumentHighlight (:range) (:kind))
(FileSystemWatcher (:globPattern) (:kind))
(Hover (:contents) (:range))
- (InitializeResult (:capabilities))
+ (InitializeResult (:capabilities) (:serverInfo))
(Location (:uri :range))
(LogMessageParams (:type :message))
(MarkupContent (:kind :value))
@@ -531,6 +531,9 @@ treated as in `eglot-dbind'."
(capabilities
:documentation "JSON object containing server capabilities."
:accessor eglot--capabilities)
+ (server-info
+ :documentation "JSON object containing server info."
+ :accessor eglot--server-info)
(shutdown-requested
:documentation "Flag set when server is shutting down."
:accessor eglot--shutdown-requested)
@@ -856,11 +859,12 @@ This docstring appeases checkdoc, that's all."
server)
:capabilities (eglot-client-capabilities server))
:success-fn
- (eglot--lambda ((InitializeResult) capabilities)
+ (eglot--lambda ((InitializeResult) capabilities
serverInfo)
(unless cancelled
(push server
(gethash project eglot--servers-by-project))
(setf (eglot--capabilities server) capabilities)
+ (setf (eglot--server-info server) serverInfo)
(jsonrpc-notify server :initialized
(make-hash-table))
(dolist (buffer (buffer-list))
(with-current-buffer buffer
@@ -888,7 +892,9 @@ This docstring appeases checkdoc, that's all."
(eglot--message
"Connected! Server `%s' now managing `%s' buffers \
in project `%s'."
- (jsonrpc-name server) managed-major-mode
+ (or (plist-get serverInfo :name)
+ (jsonrpc-name server))
+ managed-major-mode
(eglot--project-nickname server))
(when tag (throw tag t))))
:timeout eglot-connect-timeout
- [elpa] externals/eglot 76d8f49 10/54: Per #50: use completionItem/resolve more abundantly, (continued)
- [elpa] externals/eglot 76d8f49 10/54: Per #50: use completionItem/resolve more abundantly, João Távora, 2020/04/16
- [elpa] externals/eglot a6fa773 25/54: Resolve compilation warnings, João Távora, 2020/04/16
- [elpa] externals/eglot b2e4687 29/54: Close #376: add metals as the language server for Scala, João Távora, 2020/04/16
- [elpa] externals/eglot 097eed5 31/54: Close #382: new eglot-confirm-server-initiated-edits defcustom, João Távora, 2020/04/16
- [elpa] externals/eglot 2ab8b59 08/54: Don't run mode hooks in eglot--format-markup, João Távora, 2020/04/16
- [elpa] externals/eglot 88311a2 12/54: Simplify "maybe"-activation, dump "server" arg, João Távora, 2020/04/16
- [elpa] externals/eglot 7f9784c 11/54: Merge -onoff proxy code into minor mode function, João Távora, 2020/04/16
- [elpa] externals/eglot 9eac9de 16/54: Fix #341: protect against empty-string insertText in completions, João Távora, 2020/04/16
- [elpa] externals/eglot b406818 07/54: Fix #326: support workspace/configuration, João Távora, 2020/04/16
- [elpa] externals/eglot ef34797 14/54: Fix #340: Don't choke on workspace/configuration with no scopeUri, João Távora, 2020/04/16
- [elpa] externals/eglot 27fb0c6 18/54: Support serverInfo of LSP 3.15.0,
João Távora <=
- [elpa] externals/eglot 893a05a 20/54: Fix #330: ensure process starts in project's root, João Távora, 2020/04/16
- [elpa] externals/eglot 678feb9 21/54: * eglot.el (eglot-completion-at-point): Remove spurious unrelated change., João Távora, 2020/04/16
- [elpa] externals/eglot 53056a5 22/54: Fix #349: waste less space in completion annotations, João Távora, 2020/04/16
- [elpa] externals/eglot 02f71fd 26/54: Make Travis run company-specific tests, João Távora, 2020/04/16
- [elpa] externals/eglot a7a2b52 27/54: Fix #362: unbreak window/showMessageRequest, João Távora, 2020/04/16
- [elpa] externals/eglot add568b 28/54: Fix #357: allow non-standard keys in textDocument/publishDiagnostics., João Távora, 2020/04/16
- [elpa] externals/eglot 3879d57 33/54: * eglot.el (eglot-eldoc-function): Fix outdated docstring., João Távora, 2020/04/16
- [elpa] externals/eglot a4c83a6 37/54: Merge pull request #400 from joaotavora/scratch/fix-277-exit-notification, João Távora, 2020/04/16
- [elpa] externals/eglot 7c48c7a 39/54: Document the changes in column calculation, João Távora, 2020/04/16
- [elpa] externals/eglot 2fdffef 41/54: Close #405: support bug-reference-prog-mode, João Távora, 2020/04/16