diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 29e6c269fdf..ee76d2fd5e4 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -675,6 +675,7 @@ This can be useful when using docker to run a language server.") (defconst eglot--uri-path-allowed-chars (let ((vec (copy-sequence url-path-allowed-chars))) (aset vec ?: nil) ;; see github#639 + (aset vec ?% nil) ;; see bug#78984 vec) "Like `url-path-allowed-chars' but more restrictive.") @@ -2008,12 +2009,6 @@ If optional MARKER, return a marker instead" ;;; More helpers -(defconst eglot--uri-path-allowed-chars - (let ((vec (copy-sequence url-path-allowed-chars))) - (aset vec ?: nil) ;; see github#639 - vec) - "Like `url-path-allowed-chars' but more restrictive.") - (defun eglot--snippet-expansion-fn () "Compute a function to expand snippets. Doubles as an indicator of snippet support." diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index 7fd4f0f0491..b01b7d269ec 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el @@ -1469,6 +1469,10 @@ GUESSED-MAJOR-MODES-SYM are bound to the useful return values of (should (string-suffix-p "c%3A/Users/Foo/bar.lisp" (eglot-path-to-uri "c:/Users/Foo/bar.lisp")))) +(ert-deftest eglot-test-path-to-uri-escape () + (should (equal "file:///path/with%20%25%20funny%20%3F%20characters" + (eglot-path-to-uri "/path/with % funny ? characters")))) + (ert-deftest eglot-test-same-server-multi-mode () "Check single LSP instance manages multiple modes in same project." (skip-unless (executable-find "clangd"))