[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 6f0a8df 008/139: Organize a bit
From: |
João Távora |
Subject: |
[elpa] externals/eglot 6f0a8df 008/139: Organize a bit |
Date: |
Mon, 14 May 2018 09:54:41 -0400 (EDT) |
branch: externals/eglot
commit 6f0a8dffc75c053df1f4e952ee0826df5195c798
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Organize a bit
---
eglot.el | 50 ++++++++++++++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/eglot.el b/eglot.el
index c7f8774..e3b288b 100644
--- a/eglot.el
+++ b/eglot.el
@@ -148,25 +148,6 @@
(format "\n-----------------------------------\n"))))
(eglot--protocol-initialize proc interactive))))))
-(defun eglot-quit-server (process &optional sync)
- (interactive (list (eglot--current-process-or-lose)))
- (eglot--message "Asking server to terminate")
- (eglot--request
- process
- :shutdown
- nil
- (lambda (&rest _anything)
- (eglot--message "Now asking server to exit")
- (process-put process 'eglot--moribund t)
- (eglot--process-send process
- `(:jsonrpc "2.0"
- :method :exit)))
- :async-p (not sync)
- :timeout-fn (lambda ()
- (eglot--warn "Brutally deleting existing process %s"
- process)
- (process-put process 'eglot--moribund t)
- (delete-process process))))
(defun eglot--process-sentinel (process change)
(with-current-buffer (process-buffer process)
@@ -359,6 +340,9 @@
(eglot--error "Process %s died unexpectedly" process))
(accept-process-output nil 0.01))))))
+
+;;; Requests
+;;;
(defun eglot--protocol-initialize (process interactive)
(eglot--request
@@ -366,6 +350,7 @@
:initialize
`(:processId ,(emacs-pid)
:rootPath ,(concat "" ;; FIXME RLS doesn't like "file://"
+ "file://"
(expand-file-name (car (project-roots
(project-current)))))
:initializationOptions []
@@ -396,7 +381,26 @@
"So yeah I got lots (%d) of capabilities"
(length all)))))))
-(defun eglot--debug (format &rest args)
+(defun eglot-quit-server (process &optional sync)
+ (interactive (list (eglot--current-process-or-lose)))
+ (eglot--message "Asking server to terminate")
+ (eglot--request
+ process
+ :shutdown
+ nil
+ (lambda (&rest _anything)
+ (eglot--message "Now asking server to exit")
+ (process-put process 'eglot--moribund t)
+ (eglot--process-send process
+ `(:jsonrpc "2.0"
+ :method :exit)))
+ :async-p (not sync)
+ :timeout-fn (lambda ()
+ (eglot--warn "Brutally deleting existing process %s"
+ process)
+ (process-put process 'eglot--moribund t)
+ (delete-process process))))
+
;;; Notifications
;;;
@@ -405,6 +409,12 @@
"Handle notification publishDiagnostics"
(eglot--message "So yeah I got %s for %s"
diagnostics uri))
+
+
+;;; Helpers
+;;;
+(defun
+ eglot--debug (format &rest args)
(display-warning 'eglot
(apply #'format format args)
:debug))
- [elpa] branch externals/eglot created (now 4c0bfc3), João Távora, 2018/05/14
- [elpa] externals/eglot 3a8f9a1 002/139: Remove a couple of comments, João Távora, 2018/05/14
- [elpa] externals/eglot 72895ca 006/139: Handle notifications, João Távora, 2018/05/14
- [elpa] externals/eglot 0222e7e 007/139: Improve `eglot--current-process', João Távora, 2018/05/14
- [elpa] externals/eglot 2775dea 003/139: Rename eglot--continuations eglot--pending-continuations, João Távora, 2018/05/14
- [elpa] externals/eglot c417eb4 009/139: Cancel timeouts when process dies unexpectedly, João Távora, 2018/05/14
- [elpa] externals/eglot 6f0a8df 008/139: Organize a bit,
João Távora <=
- [elpa] externals/eglot c222c3b 019/139: Lay groundwork for uniform treatment of network connections, João Távora, 2018/05/14
- [elpa] externals/eglot 3489176 004/139: Add a mode-line construct and some minor fanciness, João Távora, 2018/05/14
- [elpa] externals/eglot dfab9a0 011/139: Experimental diagnostic overlays, João Távora, 2018/05/14
- [elpa] externals/eglot 16be2fc 020/139: Fix parser to accept multiple messages in one chunk, João Távora, 2018/05/14
- [elpa] externals/eglot 0ec7801 012/139: Simplify `eglot--protocol-initialize`, João Távora, 2018/05/14
- [elpa] externals/eglot 4f246b5 017/139: * eglot.el (eglot-mode-map): Move up before minor mode., João Távora, 2018/05/14
- [elpa] externals/eglot bc011d0 010/139: Minor cleanup, João Távora, 2018/05/14
- [elpa] externals/eglot e60c7fc 013/139: Overhaul async mechanism safety, João Távora, 2018/05/14
- [elpa] externals/eglot a4f99e0 005/139: Introduce and use `eglot--current-process-or-lose', João Távora, 2018/05/14
- [elpa] externals/eglot efd14d6 015/139: Fix mode line, João Távora, 2018/05/14