From: João Távora Date: Wed, 22 Jan 2025 21:52:56 +0000 (+0000) Subject: Eglot: unbreak completion in Emacs 26.3 (at least) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=12a0edf496487c9e6f33d8430af8eea6a65000be;p=emacs.git Eglot: unbreak completion in Emacs 26.3 (at least) For reasons yet to be investigated, in some Emacs older versions, callers of the completion table created by eglot-completion-at-point will destroy text properties in the strings returned by the "all-completions" call (destroy here means completely erase). This completely breaks Eglot completion. (eglot-completion-at-point): Copy substrings in all-completions call. (cherry picked from commit 7e2f6ce0cb1e5eb2c686451836275acf234bc354) --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4b022ca0ebd..8e889e3363f 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3302,7 +3302,9 @@ for which LSP on-type-formatting should be requested." (dolist (c comps) (eglot--dumb-flex pattern c completion-ignore-case)) (all-completions "" - comps + ;; copy strings, as some older emacs + ;; versions will destroy properties. + (mapcar #'substring comps) (lambda (proxy) (let* ((item (get-text-property 0 'eglot--lsp-item proxy)) (filterText (plist-get item :filterText)))