Package: emacs;
To reply to this bug, email your comments to 79809 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-gnu-emacs <at> gnu.org:bug#79809; Package emacs.
(Mon, 10 Nov 2025 14:40:03 GMT) Full text and rfc822 format available.hkirsch <at> posteo.de:bug-gnu-emacs <at> gnu.org.
(Mon, 10 Nov 2025 14:40:04 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: hkirsch <at> posteo.de To: bug-gnu-emacs <at> gnu.org Subject: Eglot does not yet parse LSP protocol parts FileSystemWatcher->GlobPattern->RelativePattern Date: Mon, 10 Nov 2025 11:03:39 +0000
[Message part 1 (text/plain, inline)]
Hello Team.
With recent version of eclipse.jdt.ls, Eglot throws a Lisp error during
initialization with a debug trace shown below indicating that it cannot
work with the watcher information sent back by the server.
eclipse.jdt.ls version: at least since 1.49 (what I tested).
Probably since their commit 7d8b8b4fbb0b38492f289b42de19777d77606440 Thu
Mar 6 15:23:22 2025 -0500
which has:
- public static String toGlobPattern(IPath path) {
+ public static Either<String, RelativePattern>
toGlobPattern(IPath path) {
so here they seem to start using the RelativePattern thing.
eglot-version: 1.19
emacs-version: GNU Emacs 30.2 (build 1, x86_64-pc-linux-gnu, GTK+
Version 3.24.33, cairo version 1.16.0) of 2025-08-17, modified by Debian
To reproduce:
Download eclipse jdtls from https://download.eclipse.org/jdtls/milestones/?d
Direct link:
https://www.eclipse.org/downloads/download.php?file=/jdtls/milestones/1.49.0/jdt-language-server-1.49.0-202507311558.tar.gz
After unpacking the tar.gz, configure eglot to run the bin/jdtls in the
unpacked directory as the LSP server, i.e. just make sure it is found as
the executable jdtls on PATH.
1. Extract the tgz containing:
- a fake .git subdir to let projects find the root dir
- a single Java source file, src/Fail.java
- .classpath and .project to keep jdtls at bay
- debug-trace.txt as produced by Lisp error
- eglot-events.txt
2. Run: emacs -Q -f package-initialize
3. Execute: M-x toggle-debug-on-error
4. Find file: src/Fail.java
5. Execute: M-x eglot
This produces the following debug trace also contained in the tgz:
Debugger entered--Lisp error: (wrong-type-argument char-or-string-p
(:baseUri "file:/home/harald/work/" :pattern "eglot-watchers-jdts-fail"))
eglot--glob-parse((:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail"))
eglot--glob-compile((:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail") t t)
#f(compiled-function (jsonrpc-lambda-elem79) #<bytecode
-0x139d9884ce9f11e6>)((:globPattern (:baseUri "file:/home/harald/work/"
:pattern "eglot-watchers-jdts-fail") :kind 4))
mapcar(#f(compiled-function (jsonrpc-lambda-elem79) #<bytecode
-0x139d9884ce9f11e6>) [(:globPattern "**/*.java") (:globPattern
"**/.project") (:globPattern "**/.classpath") (:globPattern
"**/.settings/*.prefs") (:globPattern "**/src/**") (:globPattern
"**/*.gradle") (:globPattern "**/*.gradle.kts") (:globPattern
"**/gradle.properties") (:globPattern "**/pom.xml") (:globPattern
(:baseUri "file:/home/harald/work/" :pattern "eglot-watchers-jdts-fail")
:kind 4)])
#f(compiled-function (arg1 arg2 arg3 &rest rest) "Handle dynamic
registration of workspace/didChangeWatchedFiles." #<bytecode
0x858a50cf23e1643>)(#<eglot-lsp-server eglot-lsp-server-1e992dbf9f91>
workspace/didChangeWatchedFiles "adb8c86a-b1a1-46e9-9a63-80f4c54ff038"
:watchers [(:globPattern "**/*.java") (:globPattern "**/.project")
(:globPattern "**/.classpath") (:globPattern "**/.settings/*.prefs")
(:globPattern "**/src/**") (:globPattern "**/*.gradle") (:globPattern
"**/*.gradle.kts") (:globPattern "**/gradle.properties") (:globPattern
"**/pom.xml") (:globPattern (:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail") :kind 4)])
apply(#f(compiled-function (arg1 arg2 arg3 &rest rest) "Handle
dynamic registration of workspace/didChangeWatchedFiles." #<bytecode
0x858a50cf23e1643>) #<eglot-lsp-server eglot-lsp-server-1e992dbf9f91>
workspace/didChangeWatchedFiles ("adb8c86a-b1a1-46e9-9a63-80f4c54ff038"
:watchers [(:globPattern "**/*.java") (:globPattern "**/.project")
(:globPattern "**/.classpath") (:globPattern "**/.settings/*.prefs")
(:globPattern "**/src/**") (:globPattern "**/*.gradle") (:globPattern
"**/*.gradle.kts") (:globPattern "**/gradle.properties") (:globPattern
"**/pom.xml") (:globPattern (:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail") :kind 4)]))
eglot-register-capability(#<eglot-lsp-server
eglot-lsp-server-1e992dbf9f91> workspace/didChangeWatchedFiles
"adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :watchers [(:globPattern
"**/*.java") (:globPattern "**/.project") (:globPattern "**/.classpath")
(:globPattern "**/.settings/*.prefs") (:globPattern "**/src/**")
(:globPattern "**/*.gradle") (:globPattern "**/*.gradle.kts")
(:globPattern "**/gradle.properties") (:globPattern "**/pom.xml")
(:globPattern (:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail") :kind 4)])
eglot--register-unregister(#<eglot-lsp-server
eglot-lsp-server-1e992dbf9f91> [(:id
"adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :method
"workspace/didChangeWatchedFiles" :registerOptions (:watchers
[(:globPattern "**/*.java") (:globPattern "**/.project") (:globPattern
"**/.classpath") (:globPattern "**/.settings/*.prefs") (:globPattern
"**/src/**") (:globPattern "**/*.gradle") (:globPattern
"**/*.gradle.kts") (:globPattern "**/gradle.properties") (:globPattern
"**/pom.xml") (:globPattern (:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail") :kind 4)]))] register)
#f(compiled-function (arg1 arg2 &rest rest) "Handle server request
client/registerCapability." #<bytecode
-0x156012ebe0c37209>)(#<eglot-lsp-server eglot-lsp-server-1e992dbf9f91>
client/registerCapability :registrations [(:id
"adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :method
"workspace/didChangeWatchedFiles" :registerOptions (:watchers
[(:globPattern "**/*.java") (:globPattern "**/.project") (:globPattern
"**/.classpath") (:globPattern "**/.settings/*.prefs") (:globPattern
"**/src/**") (:globPattern "**/*.gradle") (:globPattern
"**/*.gradle.kts") (:globPattern "**/gradle.properties") (:globPattern
"**/pom.xml") (:globPattern (:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail") :kind 4)]))])
apply(#f(compiled-function (arg1 arg2 &rest rest) "Handle server
request client/registerCapability." #<bytecode -0x156012ebe0c37209>)
#<eglot-lsp-server eglot-lsp-server-1e992dbf9f91>
client/registerCapability (:registrations [(:id
"adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :method
"workspace/didChangeWatchedFiles" :registerOptions (:watchers
[(:globPattern "**/*.java") (:globPattern "**/.project") (:globPattern
"**/.classpath") (:globPattern "**/.settings/*.prefs") (:globPattern
"**/src/**") (:globPattern "**/*.gradle") (:globPattern
"**/*.gradle.kts") (:globPattern "**/gradle.properties") (:globPattern
"**/pom.xml") (:globPattern (:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail") :kind 4)]))]))
eglot-handle-request(#<eglot-lsp-server
eglot-lsp-server-1e992dbf9f91> client/registerCapability :registrations
[(:id "adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :method
"workspace/didChangeWatchedFiles" :registerOptions (:watchers
[(:globPattern "**/*.java") (:globPattern "**/.project") (:globPattern
"**/.classpath") (:globPattern "**/.settings/*.prefs") (:globPattern
"**/src/**") (:globPattern "**/*.gradle") (:globPattern
"**/*.gradle.kts") (:globPattern "**/gradle.properties") (:globPattern
"**/pom.xml") (:globPattern (:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail") :kind 4)]))])
apply(eglot-handle-request #<eglot-lsp-server
eglot-lsp-server-1e992dbf9f91> client/registerCapability (:registrations
[(:id "adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :method
"workspace/didChangeWatchedFiles" :registerOptions (:watchers
[(:globPattern "**/*.java") (:globPattern "**/.project") (:globPattern
"**/.classpath") (:globPattern "**/.settings/*.prefs") (:globPattern
"**/src/**") (:globPattern "**/*.gradle") (:globPattern
"**/*.gradle.kts") (:globPattern "**/gradle.properties") (:globPattern
"**/pom.xml") (:globPattern (:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail") :kind 4)]))]))
#f(compiled-function (server method params) #<bytecode
0x1f1ac0b30d0648aa>)(#<eglot-lsp-server eglot-lsp-server-1e992dbf9f91>
client/registerCapability (:registrations [(:id
"adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :method
"workspace/didChangeWatchedFiles" :registerOptions (:watchers
[(:globPattern "**/*.java") (:globPattern "**/.project") (:globPattern
"**/.classpath") (:globPattern "**/.settings/*.prefs") (:globPattern
"**/src/**") (:globPattern "**/*.gradle") (:globPattern
"**/*.gradle.kts") (:globPattern "**/gradle.properties") (:globPattern
"**/pom.xml") (:globPattern (:baseUri "file:/home/harald/work/" :pattern
"eglot-watchers-jdts-fail") :kind 4)]))]))
jsonrpc-connection-receive(#<eglot-lsp-server
eglot-lsp-server-1e992dbf9f91> (:jsonrpc "2.0" :id "6" :method
"client/registerCapability" :params (:registrations [(:id
"adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :method
"workspace/didChangeWatchedFiles" :registerOptions (:watchers
[(:globPattern "**/*.java") (:globPattern "**/.project") (:globPattern
"**/.classpath") (:globPattern "**/.settings/*.prefs") (:globPattern
"**/src/**") (:globPattern "**/*.gradle") (:globPattern
"**/*.gradle.kts") (:globPattern "**/gradle.properties") (:globPattern
"**/pom.xml") (:globPattern ... :kind 4)]))])))
#f(compiled-function (conn msg) #<bytecode
-0x1cb2362863397428>)(#<eglot-lsp-server eglot-lsp-server-1e992dbf9f91>
(:jsonrpc "2.0" :id "6" :method "client/registerCapability" :params
(:registrations [(:id "adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :method
"workspace/didChangeWatchedFiles" :registerOptions (:watchers
[(:globPattern "**/*.java") (:globPattern "**/.project") (:globPattern
"**/.classpath") (:globPattern "**/.settings/*.prefs") (:globPattern
"**/src/**") (:globPattern "**/*.gradle") (:globPattern
"**/*.gradle.kts") (:globPattern "**/gradle.properties") (:globPattern
"**/pom.xml") (:globPattern ... :kind 4)]))])))
apply(#f(compiled-function (conn msg) #<bytecode
-0x1cb2362863397428>) (#<eglot-lsp-server eglot-lsp-server-1e992dbf9f91>
(:jsonrpc "2.0" :id "6" :method "client/registerCapability" :params
(:registrations [(:id "adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :method
"workspace/didChangeWatchedFiles" :registerOptions (:watchers [... ...
... ... ... ... ... ... ... ...]))]))))
timer-event-handler([t 26897 44860 488187 nil #f(compiled-function
(conn msg) #<bytecode -0x1cb2362863397428>) (#<eglot-lsp-server
eglot-lsp-server-1e992dbf9f91> (:jsonrpc "2.0" :id "6" :method
"client/registerCapability" :params (:registrations [(:id
"adb8c86a-b1a1-46e9-9a63-80f4c54ff038" :method
"workspace/didChangeWatchedFiles" :registerOptions (:watchers ...))])))
nil 915000 nil])
Further the following appears in the eglot events, also in the tgz
(search for baseUri):
[jsonrpc] e[10:35:52.508] <-- client/registerCapability[5]
{"jsonrpc":"2.0","id":"5","method":"client/registerCapability","params":{"registrations":[{"id":"03cb5593-e485-4fdd-83aa-e5f1c9892abe","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.java"},{"globPattern":"**/.project"},{"globPattern":"**/.classpath"},{"globPattern":"**/.settings/*.prefs"},{"globPattern":"**/src/**"},{"globPattern":"**/*.gradle"},{"globPattern":"**/*.gradle.kts"},{"globPattern":"**/gradle.properties"},{"globPattern":"**/pom.xml"},{"globPattern":{"baseUri":"file:/home/harald/work/","pattern":"eglot-watchers-jdts-fail"},"kind":4}]}}]}}
Though the pattern seems silly in the example, it is important to have
for formatter and properties files read by eclipse which are not part of
the project directory.
Regards
Harald
--
--------------+---------------------------------------
Harald Kirsch | hkirsch <at> posteo.de 0163/240 4 052
HaraldKi <at> nrw.social
[eglot-watchers-jdts-fail.tgz (application/x-compressed-tar, attachment)]
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.