* bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version}
[not found] ` <CAPVWWDWCTvjzG3CLffnaf_xgn4R-Y8=j9y3to0yCEhoAt0gPMA@mail.gmail.com>
@ 2023-06-28 21:02 ` João Távora
2023-06-29 15:46 ` Felician Nemeth
0 siblings, 1 reply; 7+ messages in thread
From: João Távora @ 2023-06-28 21:02 UTC (permalink / raw)
To: Alan Donovan, 62198, Felician Nemeth
On Wed, Jun 28, 2023 at 9:41 PM Alan Donovan <adonovan@google.com> wrote:
> > >Hi João,
> > > would you mind making eglot populate the clientInfo.{name,version}
> > > fields of the Initialize request parameters? All that's necessary is
> > > the one-line change below, though I'm sure you know a cleaner way to
> > >express the JSON literal and the version constant.
> > No I wouldn't mind.
> Great! I found that this expression works for the version, assuming
> eglot is actually installed:
>
> (package-desc-version (cadr (assoc 'eglot package-alist)))
That's the thing. Sometimes it is installed in that variable, sometimes
it's a builtin described in some other variable. There is, I think,
a library for this.
I've found the bug thread: bug#62198.
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62198
Taking the liberty of CCing there. Felicián was also looking for this.
João
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version}
2023-06-28 21:02 ` bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version} João Távora
@ 2023-06-29 15:46 ` Felician Nemeth
2023-06-29 16:02 ` João Távora
0 siblings, 1 reply; 7+ messages in thread
From: Felician Nemeth @ 2023-06-29 15:46 UTC (permalink / raw)
To: João Távora; +Cc: 62198, Alan Donovan
João Távora <joaotavora@gmail.com> writes:
> On Wed, Jun 28, 2023 at 9:41 PM Alan Donovan <adonovan@google.com> wrote:
>
>> > >Hi João,
>> > > would you mind making eglot populate the clientInfo.{name,version}
>> > > fields of the Initialize request parameters? All that's necessary is
>> > > the one-line change below, though I'm sure you know a cleaner way to
>> > >express the JSON literal and the version constant.
>> > No I wouldn't mind.
>> Great! I found that this expression works for the version, assuming
>> eglot is actually installed:
>>
>> (package-desc-version (cadr (assoc 'eglot package-alist)))
>
> That's the thing. Sometimes it is installed in that variable, sometimes
> it's a builtin described in some other variable. There is, I think,
> a library for this.
>
> I've found the bug thread: bug#62198.
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62198
>
> Taking the liberty of CCing there. Felicián was also looking for this.
If Eglot is installed, then it is byte-compiled as well. The earlier
patch in this bug report made sure that the helper library ('lisp-mnt)
was required only at compile time. However, the patch worked even if
Eglot was not installed with package.el (but Eglot still needed to be
byte-compiled).
On the other hand, if package-desc-version is acceptable as opposed to
that earlier patch, then it is probably better than not sending a
version number in clientInfo.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version}
2023-06-29 15:46 ` Felician Nemeth
@ 2023-06-29 16:02 ` João Távora
2023-07-15 10:18 ` Felician Nemeth
0 siblings, 1 reply; 7+ messages in thread
From: João Távora @ 2023-06-29 16:02 UTC (permalink / raw)
To: Felician Nemeth; +Cc: 62198, Alan Donovan
On Thu, Jun 29, 2023 at 4:46 PM Felician Nemeth
<felician.nemeth@gmail.com> wrote:
>
> João Távora <joaotavora@gmail.com> writes:
>
> > On Wed, Jun 28, 2023 at 9:41 PM Alan Donovan <adonovan@google.com> wrote:
> >
> >> > >Hi João,
> >> > > would you mind making eglot populate the clientInfo.{name,version}
> >> > > fields of the Initialize request parameters? All that's necessary is
> >> > > the one-line change below, though I'm sure you know a cleaner way to
> >> > >express the JSON literal and the version constant.
> >> > No I wouldn't mind.
> >> Great! I found that this expression works for the version, assuming
> >> eglot is actually installed:
> >>
> >> (package-desc-version (cadr (assoc 'eglot package-alist)))
> >
> > That's the thing. Sometimes it is installed in that variable, sometimes
> > it's a builtin described in some other variable. There is, I think,
> > a library for this.
> >
> > I've found the bug thread: bug#62198.
> >
> > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62198
> >
> > Taking the liberty of CCing there. Felicián was also looking for this.
>
> If Eglot is installed, then it is byte-compiled as well. The earlier
> patch in this bug report made sure that the helper library ('lisp-mnt)
> was required only at compile time. However, the patch worked even if
> Eglot was not installed with package.el (but Eglot still needed to be
> byte-compiled).
>
> On the other hand, if package-desc-version is acceptable as opposed to
> that earlier patch, then it is probably better than not sending a
> version number in clientInfo.
I thinkt the lisp-mnt-at-compile-time solution is preferable, as I'm
not sure 'eglot always lives in package-alist (sometimes it is a
built-in and that is a royal pain). Can you show an
updated patch for it, when you have time, Felicián?
João
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version}
2023-06-29 16:02 ` João Távora
@ 2023-07-15 10:18 ` Felician Nemeth
2023-08-03 7:39 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Felician Nemeth @ 2023-07-15 10:18 UTC (permalink / raw)
To: João Távora; +Cc: 62198, Alan Donovan
[-- Attachment #1: Type: text/plain, Size: 608 bytes --]
>> If Eglot is installed, then it is byte-compiled as well. The earlier
>> patch in this bug report made sure that the helper library ('lisp-mnt)
>> was required only at compile time. However, the patch worked even if
>> Eglot was not installed with package.el (but Eglot still needed to be
>> byte-compiled).
> I thinkt the lisp-mnt-at-compile-time solution is preferable, as I'm
> not sure 'eglot always lives in package-alist (sometimes it is a
> built-in and that is a royal pain). Can you show an
> updated patch for it, when you have time, Felicián?
I've attached the updated patch.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Eglot-send-version-in-clientInfo-bug-62198.patch --]
[-- Type: text/x-diff, Size: 1719 bytes --]
From df775108a9d0c5171ca6eeb19af752bec15c626a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felici=C3=A1n=20N=C3=A9meth?= <felician.nemeth@gmail.com>
Date: Sat, 15 Jul 2023 12:02:49 +0200
Subject: [PATCH] Eglot: send version in clientInfo (bug#62198)
* lisp/progmodes/eglot.el (eglot--version): New defconst.
(eglot--connect): Use it.
---
lisp/progmodes/eglot.el | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 8ac21638a5..0da4641fba 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -421,6 +421,14 @@ eglot-withhold-process-id
\f
;;; Constants
;;;
+(defconst eglot--version
+ (eval-when-compile
+ (when byte-compile-current-file
+ (require 'lisp-mnt)
+ (lm-version byte-compile-current-file)))
+ "The version as a string of this version of Eglot.
+It is nil if Eglot is not byte-complied.")
+
(defconst eglot--symbol-kind-names
`((1 . "File") (2 . "Module")
(3 . "Namespace") (4 . "Package") (5 . "Class")
@@ -1352,7 +1360,9 @@ eglot--connect
(eq (jsonrpc-process-type server)
'network))
(emacs-pid))
- :clientInfo '(:name "Eglot")
+ :clientInfo
+ `(:name "Eglot" ,@(when eglot--version
+ `(:version ,eglot--version)))
;; Maybe turn trampy `/ssh:foo@bar:/path/to/baz.py'
;; into `/path/to/baz.py', so LSP groks it.
:rootPath (file-local-name
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version}
2023-07-15 10:18 ` Felician Nemeth
@ 2023-08-03 7:39 ` Eli Zaretskii
2023-08-03 10:15 ` João Távora
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2023-08-03 7:39 UTC (permalink / raw)
To: joaotavora, Felician Nemeth; +Cc: 62198, adonovan
> Cc: 62198@debbugs.gnu.org, Alan Donovan <adonovan@google.com>
> From: Felician Nemeth <felician.nemeth@gmail.com>
> Date: Sat, 15 Jul 2023 12:18:11 +0200
>
> >> If Eglot is installed, then it is byte-compiled as well. The earlier
> >> patch in this bug report made sure that the helper library ('lisp-mnt)
> >> was required only at compile time. However, the patch worked even if
> >> Eglot was not installed with package.el (but Eglot still needed to be
> >> byte-compiled).
>
> > I thinkt the lisp-mnt-at-compile-time solution is preferable, as I'm
> > not sure 'eglot always lives in package-alist (sometimes it is a
> > built-in and that is a royal pain). Can you show an
> > updated patch for it, when you have time, Felicián?
>
> I've attached the updated patch.
Ping! João, how should we proceed with this issue?
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version}
2023-08-03 7:39 ` Eli Zaretskii
@ 2023-08-03 10:15 ` João Távora
2023-08-03 10:20 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: João Távora @ 2023-08-03 10:15 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 62198, Felician Nemeth, adonovan
Sorry,
I think Felicián's patch looks good, and we should push it to master.
João
On Thu, Aug 3, 2023 at 8:39 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > Cc: 62198@debbugs.gnu.org, Alan Donovan <adonovan@google.com>
> > From: Felician Nemeth <felician.nemeth@gmail.com>
> > Date: Sat, 15 Jul 2023 12:18:11 +0200
> >
> > >> If Eglot is installed, then it is byte-compiled as well. The earlier
> > >> patch in this bug report made sure that the helper library ('lisp-mnt)
> > >> was required only at compile time. However, the patch worked even if
> > >> Eglot was not installed with package.el (but Eglot still needed to be
> > >> byte-compiled).
> >
> > > I thinkt the lisp-mnt-at-compile-time solution is preferable, as I'm
> > > not sure 'eglot always lives in package-alist (sometimes it is a
> > > built-in and that is a royal pain). Can you show an
> > > updated patch for it, when you have time, Felicián?
> >
> > I've attached the updated patch.
>
> Ping! João, how should we proceed with this issue?
>
> Thanks.
--
João Távora
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version}
2023-08-03 10:15 ` João Távora
@ 2023-08-03 10:20 ` Eli Zaretskii
0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2023-08-03 10:20 UTC (permalink / raw)
To: João Távora; +Cc: 62198-done, felician.nemeth, adonovan
> From: João Távora <joaotavora@gmail.com>
> Date: Thu, 3 Aug 2023 11:15:50 +0100
> Cc: Felician Nemeth <felician.nemeth@gmail.com>, 62198@debbugs.gnu.org, adonovan@google.com
>
> Sorry,
>
> I think Felicián's patch looks good, and we should push it to master.
Thanks, done, and closing the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-08-03 10:20 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAPVWWDWmV3A1GhzvHFQhu2dz171ghgdwBRrtZbzWJP1ojiiO4w@mail.gmail.com>
[not found] ` <CALDnm52Jo8kQJtmLgDXHHdZWJ=OES4a2GGGU-U1VaObdN+fEBg@mail.gmail.com>
[not found] ` <CAPVWWDWCTvjzG3CLffnaf_xgn4R-Y8=j9y3to0yCEhoAt0gPMA@mail.gmail.com>
2023-06-28 21:02 ` bug#62198: eglot feature request: set Initialize.ClientInfo.{Name, Version} João Távora
2023-06-29 15:46 ` Felician Nemeth
2023-06-29 16:02 ` João Távora
2023-07-15 10:18 ` Felician Nemeth
2023-08-03 7:39 ` Eli Zaretskii
2023-08-03 10:15 ` João Távora
2023-08-03 10:20 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.