]> git.eshelyaron.com Git - emacs.git/commitdiff
Make reported capabilities into its own function
authorJoão Távora <joaotavora@gmail.com>
Fri, 4 May 2018 13:18:12 +0000 (14:18 +0100)
committerJoão Távora <joaotavora@gmail.com>
Fri, 4 May 2018 13:18:12 +0000 (14:18 +0100)
* eglot.el (eglot--client-capabilities): New function.
(eglot--connect): Use it.

lisp/progmodes/eglot.el

index 10435a16f8ae6ded7782a3ee4a7bca6b780e6b22..b305ca303c3e89b017573d10ee263bc1fc889958 100644 (file)
@@ -189,6 +189,13 @@ CONTACT is as `eglot--contact'.  Returns a process object."
                   (push sym retval))))
     retval))
 
+(defun eglot--client-capabilities ()
+  "What the EGLOT LSP client supports."
+  (eglot--obj
+   :workspace (eglot--obj)
+   :textDocument (eglot--obj
+                  :publishDiagnostics `(:relatedInformation nil))))
+
 (defun eglot--connect (project managed-major-mode
                                short-name contact &optional success-fn)
   "Connect for PROJECT, MANAGED-MAJOR-MODE, SHORT-NAME and CONTACT.
@@ -218,11 +225,7 @@ SUCCESS-FN with no args if all goes well."
                                  (expand-file-name (car (project-roots
                                                          (project-current)))))
                      :initializationOptions  []
-                     :capabilities
-                     (eglot--obj
-                      :workspace (eglot--obj)
-                      :textDocument (eglot--obj
-                                     :publishDiagnostics `(:relatedInformation t))))
+                     :capabilities (eglot--client-capabilities))
          :success-fn
          (cl-function
           (lambda (&key capabilities)