From 26bd153b9087635ca4a820e253ac0fe6ca21df64 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 13 Jan 2022 00:50:35 +0100 Subject: [PATCH] Print server command to events buffer * eglot.el (eglot--connect): Print server command to events buffer. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/476 --- lisp/progmodes/eglot.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index b97e3a4e668..9536a72a263 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1078,16 +1078,20 @@ This docstring appeases checkdoc, that's all." (nickname (file-name-base (directory-file-name default-directory))) (readable-name (format "EGLOT (%s/%s)" nickname managed-major-mode)) autostart-inferior-process + server-info (contact (if (functionp contact) (funcall contact) contact)) (initargs (cond ((keywordp (car contact)) contact) ((integerp (cadr contact)) + (setq server-info (list (format "%s:%s" (car contact) + (cadr contact)))) `(:process ,(lambda () (apply #'open-network-stream readable-name nil (car contact) (cadr contact) (cddr contact))))) ((and (stringp (car contact)) (memq :autoport contact)) + (setq server-info (list "")) `(:process ,(lambda () (pcase-let ((`(,connection . ,inferior) (eglot--inferior-bootstrap @@ -1101,7 +1105,7 @@ This docstring appeases checkdoc, that's all." (let ((default-directory default-directory)) (make-process :name readable-name - :command (eglot--cmd contact) + :command (setq server-info (eglot--cmd contact)) :connection-type 'pipe :coding 'utf-8-emacs-unix :noquery t @@ -1122,6 +1126,9 @@ This docstring appeases checkdoc, that's all." initargs)) (cancelled nil) (tag (make-symbol "connected-catch-tag"))) + (when server-info + (jsonrpc--debug server "Running language server: %s" + (string-join server-info " "))) (setf (eglot--saved-initargs server) initargs) (setf (eglot--project server) project) (setf (eglot--project-nickname server) nickname) -- 2.39.2