]> git.eshelyaron.com Git - emacs.git/commitdiff
Resolve compilation warnings
authorJoão Távora <joaotavora@gmail.com>
Wed, 20 Nov 2019 22:55:29 +0000 (22:55 +0000)
committerJoão Távora <joaotavora@gmail.com>
Wed, 20 Nov 2019 22:55:29 +0000 (22:55 +0000)
* eglot.el (company-tooltip-align-annotations): Forward declare.
(eglot--cached-server): Renamed from eglot--cached-current-server.
(eglot--managed-mode, eglot-current-server)
(eglot--current-server-or-lose)
(eglot--maybe-activate-editing-mode): use it.
(eglot-completion-at-point): Don't use insertTextFormat.

lisp/progmodes/eglot.el

index a327655a0ea579549910f0e32fa647e29a9d9ed8..90f2c68474514a9c9b2d442578f997a0fc2cdbd0 100644 (file)
@@ -71,7 +71,8 @@
 (require 'filenotify)
 (require 'ert)
 (require 'array)
-(defvar company-backends) ; forward-declare, but don't require company yet
+(defvar company-backends) ; forward-declare, but don't require company
+(defvar company-tooltip-align-annotations)
 
 
 \f
@@ -1222,6 +1223,9 @@ For example, to keep your Company customization use
      (push (cons ',symbol (symbol-value ',symbol)) eglot--saved-bindings)
      (setq-local ,symbol ,binding)))
 
+(defvar-local eglot--cached-server nil
+  "A cached reference to the current EGLOT server.")
+
 (define-minor-mode eglot--managed-mode
   "Mode for source buffers managed by some EGLOT project."
   nil nil eglot-mode-map
@@ -1251,7 +1255,7 @@ For example, to keep your Company customization use
                     #'eglot-imenu))
     (flymake-mode 1)
     (eldoc-mode 1)
-    (cl-pushnew (current-buffer) (eglot--managed-buffers eglot--cached-current-server)))
+    (cl-pushnew (current-buffer) (eglot--managed-buffers eglot--cached-server)))
    (t
     (remove-hook 'after-change-functions 'eglot--after-change t)
     (remove-hook 'before-change-functions 'eglot--before-change t)
@@ -1270,8 +1274,8 @@ For example, to keep your Company customization use
              do (set (make-local-variable var) saved-binding))
     (remove-function (local 'imenu-create-index-function) #'eglot-imenu)
     (setq eglot--current-flymake-report-fn nil)
-    (let ((server eglot--cached-current-server))
-      (setq eglot--cached-current-server nil)
+    (let ((server eglot--cached-server))
+      (setq eglot--cached-server nil)
       (when server
         (setf (eglot--managed-buffers server)
               (delq (current-buffer) (eglot--managed-buffers server)))
@@ -1284,16 +1288,13 @@ For example, to keep your Company customization use
   "Turn off `eglot--managed-mode' unconditionally."
   (eglot--managed-mode -1))
 
-(defvar-local eglot--cached-current-server nil
-  "A cached reference to the current EGLOT server.")
-
 (defun eglot-current-server ()
   "Return logical EGLOT server for current buffer, nil if none."
-  eglot--cached-current-server)
+  eglot--cached-server)
 
 (defun eglot--current-server-or-lose ()
   "Return current logical EGLOT server connection or error."
-  (or eglot--cached-current-server
+  (or eglot--cached-server
       (jsonrpc-error "No current JSON-RPC connection")))
 
 (defvar-local eglot--unreported-diagnostics nil
@@ -1313,8 +1314,8 @@ If it is activated, also signal textDocument/didOpen."
     ;; `revert-buffer-preserve-modes' is nil.
     (when (and buffer-file-name
                (or
-                eglot--cached-current-server
-                (setq eglot--cached-current-server
+                eglot--cached-server
+                (setq eglot--cached-server
                       (cl-find major-mode
                                (gethash (or (project-current)
                                             `(transient . ,default-directory))
@@ -2026,7 +2027,7 @@ is not active."
             (funcall proxies)))))
        :annotation-function
        (lambda (proxy)
-         (eglot--dbind ((CompletionItem) detail kind insertTextFormat)
+         (eglot--dbind ((CompletionItem) detail kind)
              (get-text-property 0 'eglot--lsp-item proxy)
            (let* ((detail (and (stringp detail)
                                (not (string= detail ""))