From adbed0c21ae0e06c374a035c7f424d8e93b1e70e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 4 May 2018 14:18:12 +0100 Subject: [PATCH] Make reported capabilities into its own function * eglot.el (eglot--client-capabilities): New function. (eglot--connect): Use it. --- lisp/progmodes/eglot.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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) -- 2.39.2