[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa e1d36d2 014/139: Fix some byte-compilation warning
From: |
João Távora |
Subject: |
[elpa] externals/elpa e1d36d2 014/139: Fix some byte-compilation warnings |
Date: |
Mon, 14 May 2018 09:53:26 -0400 (EDT) |
branch: externals/elpa
commit e1d36d27a2b6566fdd8cf16d0fcd2a9ec033a65d
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Fix some byte-compilation warnings
---
eglot.el | 82 ++++++++++++++++++++++++++++++++++++----------------------------
1 file changed, 46 insertions(+), 36 deletions(-)
diff --git a/eglot.el b/eglot.el
index af9904a..0a52da7 100644
--- a/eglot.el
+++ b/eglot.el
@@ -27,6 +27,7 @@
(require 'json)
(require 'cl-lib)
(require 'project)
+(require 'url-parse)
(defgroup eglot nil
"Interaction with Language Server Protocol servers"
@@ -211,8 +212,10 @@
(goto-char message-mark)
(narrow-to-region message-mark
message-end)
- (eglot--process-receive proc
(let ((json-object-type 'plist))
- (json-read)))))
+ (eglot--process-receive
+ proc
+ (let ((json-object-type 'plist))
+ (json-read)))))
(set-marker message-mark message-end)
(setf (eglot--expected-bytes proc) nil)))
(t
@@ -258,21 +261,21 @@
(not continuations))
(eglot--warn "Ooops no continuation for id %s" response-id))
(continuations
- (cancel-timer (third continuations))
+ (cancel-timer (cl-third continuations))
(remhash response-id
(eglot--pending-continuations))
(cond (err
- (apply (second continuations) err))
+ (apply (cl-second continuations) err))
(t
- (apply (first continuations) (plist-get message :result)))))
+ (apply (cl-first continuations) (plist-get message
:result)))))
(t
(let* ((method (plist-get message :method))
(handler-sym (intern (concat "eglot--"
- method))))
+ method))))
(if (functionp handler-sym)
(apply handler-sym proc (plist-get message :params))
(eglot--debug "No implemetation for notification %s yet"
- method)))))))
+ method)))))))
(defvar eglot--expect-carriage-return nil)
@@ -294,9 +297,9 @@
(clrhash (eglot--pending-continuations process)))
(cl-defun eglot--request (process
- method
- params
- &key success-fn error-fn timeout-fn (async-p t))
+ method
+ params
+ &key success-fn error-fn timeout-fn (async-p t))
(let* ((id (eglot--next-request-id))
(timeout-fn
(or timeout-fn
@@ -363,6 +366,9 @@
;;; Requests
;;;
(defun eglot--protocol-initialize (process interactive)
+ "Initialize LSP protocol.
+PROCESS is a connected process (network or local).
+INTERACTIVE is t if caller was called interactively."
(eglot--request
process
:initialize
@@ -385,7 +391,7 @@
(defun eglot-quit-server (process &optional sync interactive)
"Politely ask the server PROCESS to quit.
If SYNC, don't leave this function with the server still
-running."
+running. INTERACTIVE is t if called interactively."
(interactive (list (eglot--current-process-or-lose) t t))
(when interactive
(eglot--message "(eglot-quit-server) Asking %s politely to terminate"
@@ -437,47 +443,50 @@ running."
(forward-line (plist-get pos-plist :line))
(forward-char (plist-get pos-plist :character))
(point))))
- (loop for diag across diagnostics
- do (cl-destructuring-bind (&key range severity
- _code _source message)
- diag
- (cl-destructuring-bind (&key start end)
- range
- (let* ((begin-pos (pos-at start))
- (end-pos (pos-at end))
- (ov (make-overlay begin-pos
- end-pos
- buffer)))
- (push ov eglot--diagnostic-overlays)
- (overlay-put ov 'face
- (case severity
- (1 'flymake-errline)
- (2 'flymake-warnline)))
- (overlay-put ov 'help-echo
- message)
- (overlay-put ov 'eglot--diagnostic diag))))))))
+ (cl-loop for diag across diagnostics
+ do (cl-destructuring-bind (&key range severity
+ _code _source message)
+ diag
+ (cl-destructuring-bind (&key start end)
+ range
+ (let* ((begin-pos (pos-at start))
+ (end-pos (pos-at end))
+ (ov (make-overlay begin-pos
+ end-pos
+ buffer)))
+ (push ov eglot--diagnostic-overlays)
+ (overlay-put ov 'face
+ (cl-case severity
+ (1 'flymake-errline)
+ (2 'flymake-warnline)))
+ (overlay-put ov 'help-echo
+ message)
+ (overlay-put ov 'eglot--diagnostic diag))))))))
(t
(eglot--message "OK so %s isn't visited" filename)))))
;;; Helpers
;;;
-(defun
- eglot--debug (format &rest args)
+(defun eglot--debug (format &rest args)
+ "Debug message FORMAT with ARGS."
(display-warning 'eglot
- (apply #'format format args)
- :debug))
+ (apply #'format format args)
+ :debug))
(defun eglot--error (format &rest args)
+ "Error out with FORMAT with ARGS."
(error (apply #'format format args)))
(defun eglot--message (format &rest args)
+ "Message out with FORMAT with ARGS."
(message (concat "[eglot] " (apply #'format format args))))
(defun eglot--warn (format &rest args)
+ "Warning message with FORMAT and ARGS."
(display-warning 'eglot
- (apply #'format format args)
- :warning))
+ (apply #'format format args)
+ :warning))
@@ -504,6 +513,7 @@ running."
(put 'eglot--mode-line-format 'risky-local-variable t)
(defun eglot--mode-line-format ()
+ "Compose the mode-line format spec."
(let* ((proc (eglot--current-process))
(name (and proc
(process-live-p proc)
- [elpa] externals/elpa 6f0a8df 008/139: Organize a bit, (continued)
- [elpa] externals/elpa 6f0a8df 008/139: Organize a bit, João Távora, 2018/05/14
- [elpa] externals/elpa 0222e7e 007/139: Improve `eglot--current-process', João Távora, 2018/05/14
- [elpa] externals/elpa 7c82a03 024/139: Start experimenting with python, João Távora, 2018/05/14
- [elpa] externals/elpa 8bd634c 016/139: Start working on this again, João Távora, 2018/05/14
- [elpa] externals/elpa dfab9a0 011/139: Experimental diagnostic overlays, João Távora, 2018/05/14
- [elpa] externals/elpa 22dc2f7 034/139: Ready to start fixing flymake integration, João Távora, 2018/05/14
- [elpa] externals/elpa 931093e 032/139: Don't clutter UI with warnings, João Távora, 2018/05/14
- [elpa] externals/elpa c948713 035/139: Auto-reconnect on unexpected connection loss, João Távora, 2018/05/14
- [elpa] externals/elpa 3489176 004/139: Add a mode-line construct and some minor fanciness, João Távora, 2018/05/14
- [elpa] externals/elpa bc011d0 010/139: Minor cleanup, João Távora, 2018/05/14
- [elpa] externals/elpa e1d36d2 014/139: Fix some byte-compilation warnings,
João Távora <=
- [elpa] externals/elpa 1dc2a9f 021/139: Implement spinners and RLS's window/progress, João Távora, 2018/05/14
- [elpa] externals/elpa 95983c9 028/139: Change status to error everytime an error is found, João Távora, 2018/05/14
- [elpa] externals/elpa 328c7ae 025/139: Auto update mode-line after setting some process properties, João Távora, 2018/05/14
- [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