[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa a3545fb 050/139: Rename RPC methods for clarity
From: |
João Távora |
Subject: |
[elpa] externals/elpa a3545fb 050/139: Rename RPC methods for clarity |
Date: |
Mon, 14 May 2018 09:53:33 -0400 (EDT) |
branch: externals/elpa
commit a3545fbf2a0e896b7129a49d3eafe1f4c0dee98b
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Rename RPC methods for clarity
* eglot.el (eglot--process-receive): Search for RPC server methods
under `eglot--server-'
(eglot-editing-mode, eglot--maybe-activate-editing-mode): Use new
signal names.
(eglot--server-window/showMessage): Rename from
eglot--window/showMessage.
(eglot--server-textDocument/publishDiagnostics): Renamed from
eglot--textDocument/publishDiagnostics.
(eglot--current-buffer-versioned-identifier): Remove.
(eglot--current-buffer-VersionedTextDocumentIdentifier): Use
eglot--versioned-identifier.
(eglot--signal-textDocument/didChange): Renamed from
eglot--maybe-signal-didChange.
(eglot--signal-textDocument/didOpen): Renamed from
eglot--signalDidOpen.
(eglot--signal-textDocument/didClose): Rename from
eglot--signalDidClose.
(eglot-flymake-backend): Call eglot--signal-textDocument/didChange.
(eglot--server-window/progress): Rename from
eglot--window/progress.
---
eglot.el | 36 ++++++++++++++++--------------------
1 file changed, 16 insertions(+), 20 deletions(-)
diff --git a/eglot.el b/eglot.el
index 7d44e6d..469d3f7 100644
--- a/eglot.el
+++ b/eglot.el
@@ -455,12 +455,12 @@ identifier. ERROR is non-nil if this is an error."
(apply (cl-first continuations) (plist-get message
:result)))))
(t
(let* ((method (plist-get message :method))
- (handler-sym (intern (concat "eglot--"
+ (handler-sym (intern (concat "eglot--server-"
method))))
(if (functionp handler-sym)
(apply handler-sym proc (plist-get message :params))
- (eglot--debug "No implemetation for notification %s yet"
- method)))))))
+ (eglot--warn "No implemetation for notification %s yet"
+ method)))))))
(defvar eglot--expect-carriage-return nil)
@@ -612,15 +612,15 @@ identifier. ERROR is non-nil if this is an error."
(eglot-mode 1)
(add-hook 'after-change-functions 'eglot--after-change nil t)
(add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t)
- (add-hook 'kill-buffer-hook 'eglot--signalDidClose nil t)
+ (add-hook 'kill-buffer-hook 'eglot--signal-textDocument/didClose nil t)
(flymake-mode 1)
(if (eglot--current-process)
- (eglot--signalDidOpen)
+ (eglot--signal-textDocument/didOpen)
(eglot--warn "No process, start one with `M-x eglot'")))
(t
(remove-hook 'flymake-diagnostic-functions 'eglot-flymake-backend t)
(remove-hook 'after-change-functions 'eglot--after-change t)
- (remove-hook 'kill-buffer-hook 'eglot--signalDidClose t))))
+ (remove-hook 'kill-buffer-hook 'eglot--signal-textDocument/didClose t))))
(define-minor-mode eglot-mode
"Minor mode for all buffers managed by EGLOT in some way." nil
@@ -643,7 +643,7 @@ that case, also signal textDocument/didOpen."
(and proc (eq proc cur)))
(unless eglot-editing-mode
(eglot-editing-mode 1))
- (eglot--signalDidOpen)
+ (eglot--signal-textDocument/didOpen)
(flymake-start)))))
(add-hook 'find-file-hook 'eglot--maybe-activate-editing-mode)
@@ -805,7 +805,7 @@ running. INTERACTIVE is t if called interactively."
:async-p (not sync)
:timeout-fn brutal)))
-(cl-defun eglot--window/showMessage
+(cl-defun eglot--server-window/showMessage
(process &key type message)
"Handle notification window/showMessage"
(when (<= 1 type)
@@ -821,7 +821,7 @@ running. INTERACTIVE is t if called interactively."
(defvar-local eglot--unreported-diagnostics nil
"Unreported diagnostics for this buffer.")
-(cl-defun eglot--textDocument/publishDiagnostics
+(cl-defun eglot--server-textDocument/publishDiagnostics
(_process &key uri diagnostics)
"Handle notification publishDiagnostics"
(let* ((obj (url-generic-parse-url uri))
@@ -873,11 +873,6 @@ running. INTERACTIVE is t if called interactively."
(defvar-local eglot--versioned-identifier 0)
-(defun eglot--current-buffer-versioned-identifier ()
- "Return a VersionedTextDocumentIdentifier."
- ;; FIXME: later deal with workspaces
- eglot--versioned-identifier)
-
(defun eglot--current-buffer-VersionedTextDocumentIdentifier ()
"Compute VersionedTextDocumentIdentifier object for current buffer."
(eglot--obj :uri
@@ -885,7 +880,8 @@ running. INTERACTIVE is t if called interactively."
(url-hexify-string
(file-truename buffer-file-name)
url-path-allowed-chars))
- :version (eglot--current-buffer-versioned-identifier)))
+ ;; FIXME: later deal with workspaces
+ :version eglot--versioned-identifier))
(defun eglot--current-buffer-TextDocumentItem ()
"Compute TextDocumentItem object for current buffer."
@@ -907,7 +903,7 @@ Records START, END and LENGTH locally."
;; (eglot--message "start is %s, end is %s, length is %s" start end length)
)
-(defun eglot--maybe-signal-didChange ()
+(defun eglot--signal-textDocument/didChange ()
"Send textDocument/didChange to server."
(when eglot--recent-changes
(save-excursion
@@ -940,14 +936,14 @@ Records START, END and LENGTH locally."
:text (buffer-substring-no-properties start end))))))))
(setq eglot--recent-changes nil)))
-(defun eglot--signalDidOpen ()
+(defun eglot--signal-textDocument/didOpen ()
"Send textDocument/didOpen to server."
(eglot--notify (eglot--current-process-or-lose)
:textDocument/didOpen
(eglot--obj :textDocument
(eglot--current-buffer-TextDocumentItem))))
-(defun eglot--signalDidClose ()
+(defun eglot--signal-textDocument/didClose ()
"Send textDocument/didClose to server."
(eglot--notify (eglot--current-process-or-lose)
:textDocument/didClose
@@ -966,12 +962,12 @@ Calls REPORT-FN maybe if server publishes diagnostics in
time."
(setq eglot--current-flymake-report-fn report-fn)
;; Take this opportunity to signal a didChange that might eventually
;; make the server report new diagnostics.
- (eglot--maybe-signal-didChange))
+ (eglot--signal-textDocument/didChange))
;;; Rust-specific
;;;
-(cl-defun eglot--window/progress
+(cl-defun eglot--server-window/progress
(process &key id done title )
"Handle notification window/progress"
(setf (eglot--spinner process) (list id title done)))
- [elpa] externals/elpa 2775dea 003/139: Rename eglot--continuations eglot--pending-continuations, (continued)
- [elpa] externals/elpa 2775dea 003/139: Rename eglot--continuations eglot--pending-continuations, João Távora, 2018/05/14
- [elpa] externals/elpa 75495dc 033/139: Slightly more user friendly start, João Távora, 2018/05/14
- [elpa] externals/elpa 6f6f01d 018/139: Doc fixes, João Távora, 2018/05/14
- [elpa] externals/elpa 0ec7801 012/139: Simplify `eglot--protocol-initialize`, João Távora, 2018/05/14
- [elpa] externals/elpa 88e3655 040/139: Appease checkdoc.el, João Távora, 2018/05/14
- [elpa] externals/elpa f7f77e1 044/139: Make M-x eglot the main entry point, João Távora, 2018/05/14
- [elpa] externals/elpa 51ff863 046/139: Must re-announce didOpen after reconnect, João Távora, 2018/05/14
- [elpa] externals/elpa d2eca65 045/139: Fix another Flymake sync bug, João Távora, 2018/05/14
- [elpa] externals/elpa c95a0a4 041/139: Multiple servers per project are possible, João Távora, 2018/05/14
- [elpa] externals/elpa e60c7fc 013/139: Overhaul async mechanism safety, João Távora, 2018/05/14
- [elpa] externals/elpa a3545fb 050/139: Rename RPC methods for clarity,
João Távora <=
- [elpa] externals/elpa 4d4b85d 061/139: eglot-editing-mode becomes eglot--managed-mode, João Távora, 2018/05/14
- [elpa] externals/elpa 4f246b5 017/139: * eglot.el (eglot-mode-map): Move up before minor mode., João Távora, 2018/05/14
- [elpa] externals/elpa a4f99e0 005/139: Introduce and use `eglot--current-process-or-lose', João Távora, 2018/05/14
- [elpa] externals/elpa 8e6488f 023/139: Don't switch to possibly dead buffer in sentinel, João Távora, 2018/05/14
- [elpa] externals/elpa be52e1e 037/139: Rework connection restarting again, João Távora, 2018/05/14
- [elpa] externals/elpa cc183a6 043/139: Fix assorted bugs, João Távora, 2018/05/14
- [elpa] externals/elpa e8f859e 031/139: Rework commands for connecting and reconnecting, João Távora, 2018/05/14
- [elpa] externals/elpa b511b7d 036/139: Redesign and simplify parser, João Távora, 2018/05/14
- [elpa] externals/elpa b4dd4f8 022/139: Report server status in the mode-line, João Távora, 2018/05/14
- [elpa] externals/elpa 46bb1c0 049/139: Reorganize file, João Távora, 2018/05/14