emacs-diffs
[Top][All Lists]
Advanced

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

feature/eglot2emacs 512d8b9f59 011/120: Add variable to withhold the ini


From: João Távora
Subject: feature/eglot2emacs 512d8b9f59 011/120: Add variable to withhold the init req process id
Date: Thu, 20 Oct 2022 07:16:45 -0400 (EDT)

branch: feature/eglot2emacs
commit 512d8b9f590df3b553526bffb7b39ee4f0cd76e9
Author: Martin Carlson <spearalot@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Add variable to withhold the init req process id
    
    * eglot.el (eglot-withhold-process-id): New defvar.
    (eglot--connect): Don't send pid to language server if above new
    defvar has a non-nil value.
    
    Copyright-paperwork-exempt: Yes
    GitHub-reference: fix https://github.com/joaotavora/eglot/issues/722
---
 lisp/progmodes/eglot.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index e1eb9ed4ce..712ad17298 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -295,6 +295,10 @@ let the buffer grow forever."
   "If non-nil, activate Eglot in cross-referenced non-project files."
   :type 'boolean)
 
+(defvar eglot-withhold-process-id nil
+  "If non-nil, Eglot will not send the Emacs process id to the language server.
+This can be useful when using docker to run a language server.")
+
 ;; Customizable via `completion-category-overrides'.
 (when (assoc 'flex completion-styles-alist)
   (add-to-list 'completion-category-defaults '(eglot (styles flex basic))))
@@ -1110,7 +1114,8 @@ This docstring appeases checkdoc, that's all."
                       server
                       :initialize
                       (list :processId
-                            (unless (or (file-remote-p default-directory)
+                            (unless (or eglot-withhold-process-id
+                                        (file-remote-p default-directory)
                                         (eq (jsonrpc-process-type server)
                                             'network))
                               (emacs-pid))



reply via email to

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