emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/elpa 6f0a8df 008/139: Organize a bit


From: João Távora
Subject: [elpa] externals/elpa 6f0a8df 008/139: Organize a bit
Date: Mon, 14 May 2018 09:53:25 -0400 (EDT)

branch: externals/elpa
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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]