[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 24741d25633: Eglot: filter by prefix in narrow-scope eglot-code-a
From: |
João Távora |
Subject: |
master 24741d25633: Eglot: filter by prefix in narrow-scope eglot-code-actions |
Date: |
Mon, 1 Jan 2024 16:13:55 -0500 (EST) |
branch: master
commit 24741d25633084101ab697ba6e28f03e1cdc8b7a
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Eglot: filter by prefix in narrow-scope eglot-code-actions
Github-reference: https://github.com/joaotavora/eglot/issues/847
Servers like typescript-language-server, when asked for {"only" :
"source.organizeImports"}, return actions with the
"source.organizeImports.ts" kind. Eglot rejected these actions, but
according to the spec:
Kinds are a hierarchical list of identifiers separated by `.` [...]
The set of kinds is open.
So I guess we can use string-prefix-p
* lisp/progmodes/eglot.el (eglot-code-actions): Use string-prefix-p.
---
lisp/progmodes/eglot.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 048cf19213c..21f485bd349 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3649,7 +3649,8 @@ at point. With prefix argument, prompt for ACTION-KIND."
;; Redo filtering, in case the `:only' didn't go through.
(actions (cl-loop for a across actions
when (or (not action-kind)
- (equal action-kind (plist-get a :kind)))
+ ;; github#847
+ (string-prefix-p action-kind (plist-get a
:kind)))
collect a)))
(if interactive
(eglot--read-execute-code-action actions server action-kind)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 24741d25633: Eglot: filter by prefix in narrow-scope eglot-code-actions,
João Távora <=