(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)
(eglot--error "Process %s died unexpectedly" process))
(accept-process-output nil 0.01))))))
+\f
+;;; Requests
+;;;
(defun eglot--protocol-initialize (process interactive)
(eglot--request
:initialize
`(:processId ,(emacs-pid)
:rootPath ,(concat "" ;; FIXME RLS doesn't like "file://"
+ "file://"
(expand-file-name (car (project-roots
(project-current)))))
:initializationOptions []
"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))))
+
\f
;;; Notifications
;;;
"Handle notification publishDiagnostics"
(eglot--message "So yeah I got %s for %s"
diagnostics uri))
+
+\f
+;;; Helpers
+;;;
+(defun
+ eglot--debug (format &rest args)
(display-warning 'eglot
(apply #'format format args)
:debug))