emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot fdd021c 26/62: Close #61: Snappier completions th


From: Stefan Monnier
Subject: [elpa] externals/eglot fdd021c 26/62: Close #61: Snappier completions that don't hinder typing
Date: Sat, 29 Sep 2018 17:13:32 -0400 (EDT)

branch: externals/eglot
commit fdd021cbc76e3d5b1f797df6ab2bb1be11e6a835
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Close #61: Snappier completions that don't hinder typing
    
    This should improve company-capf's performance.
    
    * eglot.el (Package-Requires): Require jsonrpc 1.0,1
    (eglot-completion-at-point): Use completion-table-dynamic.  Pass
    CANCEL-ON-INPUT to jsonrpc-request.
---
 eglot.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/eglot.el b/eglot.el
index d29bef5..9e71416 100644
--- a/eglot.el
+++ b/eglot.el
@@ -7,7 +7,7 @@
 ;; Maintainer: João Távora <address@hidden>
 ;; URL: https://github.com/joaotavora/eglot
 ;; Keywords: convenience, languages
-;; Package-Requires: ((emacs "26.1") (jsonrpc "1.0.0"))
+;; Package-Requires: ((emacs "26.1") (jsonrpc "1.0.1"))
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -1275,12 +1275,13 @@ is not active."
       (list
        (or (car bounds) (point))
        (or (cdr bounds) (point))
-       (completion-table-with-cache
+       (completion-table-dynamic
         (lambda (_ignored)
           (let* ((resp (jsonrpc-request server
                                         :textDocument/completion
                                         (eglot--TextDocumentPositionParams)
-                                        :deferred :textDocument/completion))
+                                        :deferred :textDocument/completion
+                                        :cancel-on-input t))
                  (items (if (vectorp resp) resp (plist-get resp :items))))
             (mapcar
              (jsonrpc-lambda (&rest all &key label insertText 
&allow-other-keys)
@@ -1317,7 +1318,8 @@ is not active."
                           (plist-get
                            (jsonrpc-request server :completionItem/resolve
                                             (get-text-property
-                                             0 'eglot--lsp-completion obj))
+                                             0 'eglot--lsp-completion obj)
+                                            :cancel-on-input t)
                            :documentation)))))
            (when documentation
              (with-current-buffer (get-buffer-create " *eglot doc*")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]