[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot a3545fb 050/139: Rename RPC methods for clarity
From: |
João Távora |
Subject: |
[elpa] externals/eglot a3545fb 050/139: Rename RPC methods for clarity |
Date: |
Mon, 14 May 2018 09:54:52 -0400 (EDT) |
branch: externals/eglot
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/eglot 1dc2a9f 021/139: Implement spinners and RLS's window/progress, (continued)
- [elpa] externals/eglot 1dc2a9f 021/139: Implement spinners and RLS's window/progress, João Távora, 2018/05/14
- [elpa] externals/eglot 931093e 032/139: Don't clutter UI with warnings, João Távora, 2018/05/14
- [elpa] externals/eglot 95983c9 028/139: Change status to error everytime an error is found, João Távora, 2018/05/14
- [elpa] externals/eglot be52e1e 037/139: Rework connection restarting again, João Távora, 2018/05/14
- [elpa] externals/eglot d2eca65 045/139: Fix another Flymake sync bug, João Távora, 2018/05/14
- [elpa] externals/eglot f7f77e1 044/139: Make M-x eglot the main entry point, João Távora, 2018/05/14
- [elpa] externals/eglot d90efdf 001/139: Initial commit, João Távora, 2018/05/14
- [elpa] externals/eglot 1514e0f 052/139: Fix a couple of Rust-related edge cases, João Távora, 2018/05/14
- [elpa] externals/eglot b4dd4f8 022/139: Report server status in the mode-line, João Távora, 2018/05/14
- [elpa] externals/eglot 6689a15 026/139: Add eglot-clear-status interactive command, João Távora, 2018/05/14
- [elpa] externals/eglot a3545fb 050/139: Rename RPC methods for clarity,
João Távora <=
- [elpa] externals/eglot 9665a3e 051/139: Fix textDocument/didChange, João Távora, 2018/05/14
- [elpa] externals/eglot eebd32b 059/139: When user declines to reconnect, first quit existing server, João Távora, 2018/05/14
- [elpa] externals/eglot 17e0ca4 047/139: Fix Flymake diagnostic positions, João Távora, 2018/05/14
- [elpa] externals/eglot 9d404c9 054/139: Update README.md, João Távora, 2018/05/14
- [elpa] externals/eglot 29d4103 056/139: Fix mode-line mouse-clicks from outside selected window, João Távora, 2018/05/14
- [elpa] externals/eglot b1554fc 055/139: * eglot.el (eglot--process-receive): Skip null method notifs., João Távora, 2018/05/14
- [elpa] externals/eglot 51ff863 046/139: Must re-announce didOpen after reconnect, João Távora, 2018/05/14
- [elpa] externals/eglot c95a0a4 041/139: Multiple servers per project are possible, João Távora, 2018/05/14
- [elpa] externals/eglot f8bfb7e 064/139: Handle requests from server correctly, João Távora, 2018/05/14
- [elpa] externals/eglot b69302c 060/139: Make M-x eglot's interactive spec a separate function, João Távora, 2018/05/14