From: João Távora Date: Fri, 4 May 2018 13:18:12 +0000 (+0100) Subject: Make reported capabilities into its own function X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~641 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=adbed0c21ae0e06c374a035c7f424d8e93b1e70e;p=emacs.git Make reported capabilities into its own function * eglot.el (eglot--client-capabilities): New function. (eglot--connect): Use it. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 10435a16f8a..b305ca303c3 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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)