[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot bff921e 60/69: Per #319: always filter completion
From: |
João Távora |
Subject: |
[elpa] externals/eglot bff921e 60/69: Per #319: always filter completions client-side by prefix |
Date: |
Sun, 20 Oct 2019 08:21:53 -0400 (EDT) |
branch: externals/eglot
commit bff921e9dcfd110acd432a7f47de9abf08466917
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Per #319: always filter completions client-side by prefix
Prefix completion is all we get in LSP because there are some servers
that send *all* completions everytime. This is horrible, but it's the
currently defined behaviour. See
https://github.com/microsoft/language-server-protocol/issues/651.
* eglot.el (eglot-completion-at-point): Use all-completions.
---
eglot.el | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/eglot.el b/eglot.el
index f757a8a..ce3705a 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1889,7 +1889,7 @@ is not active."
(list
(or (car bounds) (point))
(or (cdr bounds) (point))
- (lambda (comp _pred action)
+ (lambda (comp pred action)
(cond
((eq action 'metadata) metadata) ; metadata
((eq action 'lambda) (member comp completions)) ; test-completion
@@ -1904,20 +1904,23 @@ is not active."
(items (if (vectorp resp) resp (plist-get resp :items))))
(setq
completions
- (mapcar
- (jsonrpc-lambda
- (&rest all &key label insertText insertTextFormat
- &allow-other-keys)
- (let ((completion
- (cond ((and (eql insertTextFormat 2)
- (eglot--snippet-expansion-fn))
- (string-trim-left label))
- (t
- (or insertText (string-trim-left label))))))
- (put-text-property 0 1 'eglot--lsp-completion
- all completion)
- completion))
- items))))))
+ (all-completions ; <-stuck with prefix-comp because <facepalm>
LSP
+ comp
+ (mapcar
+ (jsonrpc-lambda
+ (&rest all &key label insertText insertTextFormat
+ &allow-other-keys)
+ (let ((completion
+ (cond ((and (eql insertTextFormat 2)
+ (eglot--snippet-expansion-fn))
+ (string-trim-left label))
+ (t
+ (or insertText (string-trim-left label))))))
+ (put-text-property 0 1 'eglot--lsp-completion
+ all completion)
+ completion))
+ items)
+ pred))))))
:annotation-function
(lambda (obj)
(eglot--dbind ((CompletionItem) detail kind insertTextFormat)
- [elpa] externals/eglot 28d8ffe 48/69: Fix #285: unbreak Elm language server which does use :triggerCharacters, (continued)
- [elpa] externals/eglot 28d8ffe 48/69: Fix #285: unbreak Elm language server which does use :triggerCharacters, João Távora, 2019/10/20
- [elpa] externals/eglot 06ff65d 52/69: Rework and correct major part of xref glue code, João Távora, 2019/10/20
- [elpa] externals/eglot 9951dc5 62/69: Add a test for vscode-json-languageserver's completions, João Távora, 2019/10/20
- [elpa] externals/eglot 124a833 56/69: Add a test for #311 and #279, João Távora, 2019/10/20
- [elpa] externals/eglot d774754 37/69: Merge pull request #298 from jorams/nil-capabilities-as-false, João Távora, 2019/10/20
- [elpa] externals/eglot 20195e5 42/69: On buffer kill, first send didClose then teardown local structures, João Távora, 2019/10/20
- [elpa] externals/eglot 5a98c5a 55/69: Fix eglot-completion-at-point to work with bare completion-at-point, João Távora, 2019/10/20
- [elpa] externals/eglot 6a7ce66 32/69: Expand directory watcher globs containing ** (#293), João Távora, 2019/10/20
- [elpa] externals/eglot f45fdc6 31/69: Fix invalid guess for php language Server (#288), João Távora, 2019/10/20
- [elpa] externals/eglot 05c68c2 45/69: Don't send dummy JSON object in "initialized" notification (#312), João Távora, 2019/10/20
- [elpa] externals/eglot bff921e 60/69: Per #319: always filter completions client-side by prefix,
João Távora <=
- [elpa] externals/eglot 260f152 65/69: Fix #321: don't choke on single-location reply to tD/definition, João Távora, 2019/10/20
- [elpa] externals/eglot 8a17c29 61/69: Close #235: play along with LSP's filterText hacks, João Távora, 2019/10/20
- [elpa] externals/eglot f5151be 67/69: Don't immediately request completions in eglot-completion-at-point, João Távora, 2019/10/20
- [elpa] externals/eglot 74240c7 66/69: Protect against zero-length completions, João Távora, 2019/10/20