From 0ebd4a816dff264519407694ed7d8d39bbce9c5a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 22 May 2018 11:42:12 +0100 Subject: [PATCH] Fix indentation broken by the defclass monster commit * eglot.el (for, eglot-handle-notification publishDiagnostics) (eglot-handle-request registerCapability, eglot-handle-request unregisterCapability, eglot-handle-request applyEdit): fix indentation. --- lisp/progmodes/eglot.el | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 5e9bdc3566b..3d363444405 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -113,7 +113,7 @@ lasted more than that many seconds." (integer :tag "Number of seconds"))) -;;; API +;;; API (WORK-IN-PROGRESS!) ;;; (defmacro eglot--obj (&rest what) "Make WHAT a JSON object suitable for `json-encode'." @@ -302,7 +302,7 @@ class SERVER-CLASS." :initialize (eglot--obj :processId (unless (eq (process-type proc) 'network) (emacs-pid)) - :capabilities (eglot-client-capabilities) + :capabilities (eglot-client-capabilities server) :rootPath (expand-file-name (car (project-roots project))) :rootUri (eglot--path-to-uri (car (project-roots project))) :initializationOptions (eglot-initialization-options server))) @@ -820,15 +820,15 @@ If optional MARKER, return a marker instead" (insert string) (font-lock-ensure) (buffer-string)))) (defun eglot--server-capable (&rest feats) -"Determine if current server is capable of FEATS." -(cl-loop for caps = (eglot--capabilities (eglot--current-server-or-lose)) - then (cadr probe) - for feat in feats - for probe = (plist-member caps feat) - if (not probe) do (cl-return nil) - if (eq (cadr probe) t) do (cl-return t) - if (eq (cadr probe) :json-false) do (cl-return nil) - finally (cl-return (or probe t)))) + "Determine if current server is capable of FEATS." + (cl-loop for caps = (eglot--capabilities (eglot--current-server-or-lose)) + then (cadr probe) + for feat in feats + for probe = (plist-member caps feat) + if (not probe) do (cl-return nil) + if (eq (cadr probe) t) do (cl-return t) + if (eq (cadr probe) :json-false) do (cl-return nil) + finally (cl-return (or probe t)))) (defun eglot--range-region (range &optional markers) "Return region (BEG END) that represents LSP RANGE. @@ -1032,7 +1032,7 @@ function with the server still running." "Unreported diagnostics for this buffer.") (cl-defmethod eglot-handle-notification - (_server (_method (eql :textDocument/publishDiagnostics)) &key uri diagnostics) + (_server (_method (eql :textDocument/publishDiagnostics)) &key uri diagnostics) "Handle notification publishDiagnostics" (if-let ((buffer (find-buffer-visiting (eglot--uri-to-path uri)))) (with-current-buffer buffer @@ -1073,18 +1073,18 @@ THINGS are either registrations or unregisterations." (eglot--reply server jsonrpc-id :result (eglot--obj :message "OK"))) (cl-defmethod eglot-handle-request - (server id (_method (eql :client/registerCapability)) &key registrations) + (server id (_method (eql :client/registerCapability)) &key registrations) "Handle server request client/registerCapability" (eglot--register-unregister server id registrations 'register)) (cl-defmethod eglot-handle-request (server id (_method (eql :client/unregisterCapability)) - &key unregisterations) ;; XXX: "unregisterations" (sic) + &key unregisterations) ;; XXX: "unregisterations" (sic) "Handle server request client/unregisterCapability" (eglot--register-unregister server id unregisterations 'unregister)) (cl-defmethod eglot-handle-request - (server id (_method (eql :workspace/applyEdit)) &key _label edit) + (server id (_method (eql :workspace/applyEdit)) &key _label edit) "Handle server request workspace/applyEdit" (condition-case err (progn (eglot--apply-workspace-edit edit 'confirm) -- 2.39.2