Eglot: support commas in globs (bug#81425)

* lisp/progmodes/eglot.el (eglot--glob-parse): Tweak.

* test/lisp/progmodes/eglot-tests.el (eglot-test-glob-test): Add
some comma-cases.
This commit is contained in:
João Távora 2026-08-12 00:18:28 +01:00
parent 65efc35a91
commit b86b9c195b
2 changed files with 7 additions and 3 deletions

View file

@ -4967,8 +4967,8 @@ not watching some directories" eglot-max-file-watches)
(:* "\\*" eglot--glob-emit-*)
(:? "\\?" eglot--glob-emit-?)
(:{} "{[^{}]+}" eglot--glob-emit-{})
(:range "\\[\\^?[^][/,*{}]+\\]" eglot--glob-emit-range)
(:literal "[^][,*?{}]+" eglot--glob-emit-self))
(:range "\\[\\^?[^][/*{}]+\\]" eglot--glob-emit-range)
(:literal "[^][*?{}]+" eglot--glob-emit-self))
until (eobp)
collect (cl-loop
for (_token regexp emitter) in grammar

View file

@ -1492,7 +1492,11 @@ GUESSED-MAJOR-MODES-SYM are bound to the useful return values of
(should (eglot--glob-match "prefix/{**/*.js,**/foo.[0-9]}.suffix"
"prefix/a/b/c/d/foo.5.suffix"))
(should (eglot--glob-match "prefix/{**/*.js,**/foo.[0-9]}.suffix"
"prefix/a/b/c/d/foo.js.suffix")))
"prefix/a/b/c/d/foo.js.suffix"))
;; bug#81425
(should (eglot--glob-match "foo/**/notes,extra.py" "foo/bar/notes,extra.py"))
(should (eglot--glob-match "foo,bar.txt" "foo,bar.txt"))
(should (eglot--glob-match "example.[a,b]" "example.,")))
(defvar tramp-histfile-override)
(defun eglot--call-with-tramp-test (fn)