From b950cb40b63b57a647cd29eb8c78481b848d77e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Thu, 3 May 2018 13:32:20 +0100 Subject: [PATCH] Appease checkdoc.el * eglot.el (eglot--process-send, eglot--next-request-id) (eglot--current-buffer-VersionedTextDocumentIdentifier) (eglot--current-buffer-TextDocumentItem) (eglot--after-change, eglot--signalDidOpen) (eglot--signalDidClose, eglot--maybe-signal-didChange): Add docstring. --- lisp/progmodes/eglot.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 8bb0729d522..cd546a32d65 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -390,6 +390,7 @@ identifier. ERROR is non-nil if this is an error." (defvar eglot--expect-carriage-return nil) (defun eglot--process-send (id proc message) + "Send MESSAGE to PROC (ID is optional)." (let* ((json (json-encode message)) (to-send (format "Content-Length: %d\r\n\r\n%s" (string-bytes json) @@ -403,6 +404,7 @@ identifier. ERROR is non-nil if this is an error." (defvar eglot--next-request-id 0) (defun eglot--next-request-id () + "Compute the next id for a client request." (setq eglot--next-request-id (1+ eglot--next-request-id))) (defun eglot-forget-pending-continuations (process) @@ -789,6 +791,7 @@ running. INTERACTIVE is t if called interactively." eglot--versioned-identifier) (defun eglot--current-buffer-VersionedTextDocumentIdentifier () + "Compute VersionedTextDocumentIdentifier object for current buffer." (eglot--obj :uri (concat "file://" (url-hexify-string @@ -797,6 +800,7 @@ running. INTERACTIVE is t if called interactively." :version (eglot--current-buffer-versioned-identifier))) (defun eglot--current-buffer-TextDocumentItem () + "Compute TextDocumentItem object for current buffer." (append (eglot--current-buffer-VersionedTextDocumentIdentifier) (eglot--obj :languageId (cdr (assoc major-mode @@ -808,24 +812,29 @@ running. INTERACTIVE is t if called interactively." (buffer-substring-no-properties (point-min) (point-max)))))) (defun eglot--after-change (start end length) + "Hook onto `after-change-functions'. +Records START, END and LENGTH locally." (cl-incf eglot--versioned-identifier) (push (list start end length) eglot--recent-changes) ;; (eglot--message "start is %s, end is %s, length is %s" start end length) ) (defun eglot--signalDidOpen () + "Send textDocument/didOpen to server." (eglot--notify (eglot--current-process-or-lose) :textDocument/didOpen (eglot--obj :textDocument (eglot--current-buffer-TextDocumentItem)))) (defun eglot--signalDidClose () + "Send textDocument/didClose to server." (eglot--notify (eglot--current-process-or-lose) :textDocument/didClose (eglot--obj :textDocument (eglot--current-buffer-TextDocumentItem)))) (defun eglot--maybe-signal-didChange () + "Send textDocument/didChange to server." (when eglot--recent-changes (save-excursion (save-restriction -- 2.39.2