[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 194b178ef4 11/33: Close #712: Add support for Loc
From: |
Stefan Kangas |
Subject: |
[elpa] externals/eglot 194b178ef4 11/33: Close #712: Add support for LocationLink |
Date: |
Sat, 8 Jan 2022 12:30:49 -0500 (EST) |
branch: externals/eglot
commit 194b178ef41ccd3d937983f3829d44a546bb24d6
Author: Brian Leung <leungbk@mailfence.com>
Commit: João Távora <joaotavora@gmail.com>
Close #712: Add support for LocationLink
Fix #711.
LocationLink was added in version 3.14 of the protocol and is
sometimes used in lieu of Location for definition- and
reference-related requests.
* eglot.el (eglot--lsp-interface-alist): Update with LocationLink.
(eglot-client-capabilities): Advertise
textDocument.{definition,declaration,implementation,typeDefinition}.linkSupport.
(eglot--lsp-xrefs-for-method): Accept LocationLinks.
Co-authored-by: João Távora <joaotavora@gmail.com
---
eglot.el | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/eglot.el b/eglot.el
index 83bd1024a0..0f367fd220 100644
--- a/eglot.el
+++ b/eglot.el
@@ -336,6 +336,7 @@ let the buffer grow forever."
(Hover (:contents) (:range))
(InitializeResult (:capabilities) (:serverInfo))
(Location (:uri :range))
+ (LocationLink (:targetUri :targetRange :targetSelectionRange)
(:originSelectionRange))
(LogMessageParams (:type :message))
(MarkupContent (:kind :value))
(ParameterInformation (:label) (:documentation))
@@ -639,10 +640,14 @@ treated as in `eglot-dbind'."
(:labelOffsetSupport t)
:activeParameterSupport t))
:references `(:dynamicRegistration :json-false)
- :definition `(:dynamicRegistration :json-false)
- :declaration `(:dynamicRegistration :json-false)
- :implementation `(:dynamicRegistration :json-false)
- :typeDefinition `(:dynamicRegistration :json-false)
+ :definition (list :dynamicRegistration :json-false
+ :linkSupport t)
+ :declaration (list :dynamicRegistration :json-false
+ :linkSupport t)
+ :implementation (list :dynamicRegistration :json-false
+ :linkSupport t)
+ :typeDefinition (list :dynamicRegistration :json-false
+ :linkSupport t)
:documentSymbol (list
:dynamicRegistration :json-false
:hierarchicalDocumentSymbolSupport t
@@ -2186,9 +2191,15 @@ Try to visit the target file for a richer summary line."
method (append (eglot--TextDocumentPositionParams) extra-params))))
(eglot--collecting-xrefs (collect)
(mapc
- (eglot--lambda ((Location) uri range)
- (collect (eglot--xref-make-match (symbol-name (symbol-at-point))
- uri range)))
+ (lambda (loc-or-loc-link)
+ (let ((sym-name (symbol-name (symbol-at-point))))
+ (eglot--dcase loc-or-loc-link
+ (((LocationLink) targetUri targetSelectionRange)
+ (collect (eglot--xref-make-match sym-name
+ targetUri
targetSelectionRange)))
+ (((Location) uri range)
+ (collect (eglot--xref-make-match sym-name
+ uri range))))))
(if (vectorp response) response (and response (list response)))))))
(cl-defun eglot--lsp-xref-helper (method &key extra-params capability )
- [elpa] externals/eglot updated (1ac06d0bcc -> b197e092f9), Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 1460324706 03/33: Update bug_report.md, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 835aa0e9b3 06/33: Per #697, #645: Hard code an exception to "node_modules" directores, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot a5b7b7d933 04/33: Fix #688: Support multiple servers out-of-box for same mode, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 194b178ef4 11/33: Close #712: Add support for LocationLink,
Stefan Kangas <=
- [elpa] externals/eglot 122dbb9d6e 14/33: Fix typo in user-visible eglot-ignored-server-capabilities, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 9b63f21e75 15/33: Respect completion-regexp-alist in Eglot's completion table, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot c3f1b7b43f 25/33: Fix #779: Correct "GNU ELPA" typo, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 670ee61169 23/33: Close #770: Mark eglot-completion-at-point capf "non-exclusive", Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 5a717c3861 01/33: Fix #671: Allow staying out of flymake-mode, eldoc-mode, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 44504db1ea 28/33: Use `locate-user-emacs-file` instead of `concat`, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 5cc8df63d8 08/33: Fix #702: Consider TRAMP in eglot-alternatives, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 0e6c0619da 09/33: Fix #703: Don't call eglot--executable-find more than needed, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot c17bdf6c98 16/33: Fixup last commit, Stefan Kangas, 2022/01/08
- [elpa] externals/eglot 8b15bf726f 19/33: Test javascript-basic with typescript-language-server, Stefan Kangas, 2022/01/08