You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the CIDER connection is closed, other CAPFs, that were added before it or after it remain.
Actual behavior
CIDER reverts completion-at-point-functions to its global value.
Steps to reproduce the problem
With eglot active in the buffer, observe the value of completion-at-point-functions:
Its value is (eglot-completion-at-point t)
Local in buffer foo.clj; global value is
(cape-file cape-dabbrev)
Start CIDER, see that completion-at-point-functions now has both cider-complete-at-point and eglot-completion-at-point:
Its value is (cider-complete-at-point eglot-completion-at-point t)
Local in buffer foo.clj; global value is
(cape-file cape-dabbrev)
Disable CIDER with ,sayonara. The value of completion-at-point-functions becomes:
Its value is (cape-file cape-dabbrev)
Why having multiple CPFS is good for me:
When I have both clojure-lsp and CIDER in a clojure buffer, CIDER's CAPF is preferred, which is good, as I like it more. But if I need to disable CIDER for any reason I'd still like to have completion from Eglot. The same goes for lsp-mode, as it sets CAPFs in a similar way.
On contrary, if I disable eglot it only removes the eglot-completion-at-point from the list, without resetting it to a global value, which is what I'd expect from CIDER. Here's the relevant code:
Expected behavior
When the CIDER connection is closed, other CAPFs, that were added before it or after it remain.
Actual behavior
CIDER reverts
completion-at-point-functions
to its global value.Steps to reproduce the problem
With
eglot
active in the buffer, observe the value ofcompletion-at-point-functions
:Start CIDER, see that
completion-at-point-functions
now has bothcider-complete-at-point
andeglot-completion-at-point
:Disable CIDER with
,sayonara
. The value ofcompletion-at-point-functions
becomes:Why having multiple CPFS is good for me:
When I have both clojure-lsp and CIDER in a clojure buffer, CIDER's CAPF is preferred, which is good, as I like it more. But if I need to disable CIDER for any reason I'd still like to have completion from Eglot. The same goes for
lsp-mode
, as it sets CAPFs in a similar way.On contrary, if I disable
eglot
it only removes theeglot-completion-at-point
from the list, without resetting it to a global value, which is what I'd expect from CIDER. Here's the relevant code:https://github.com/joaotavora/eglot/blob/83a61f673a0395e9ea3f17f8bf7afd7da37bce03/eglot.el#L1624
https://github.com/joaotavora/eglot/blob/83a61f673a0395e9ea3f17f8bf7afd7da37bce03/eglot.el#L1653
For comparison, here's how CIDER does this:
cider/cider-mode.el
Line 1057 in 398b370
cider/cider-mode.el
Line 1076 in 398b370
This
kill-local-variable
may make sense for other variables, but forcompletion-at-point-functions
seems like an oversight.Environment & Version information
CIDER version information
Include here the version string displayed when
CIDER's REPL is launched. Here's an example:
Lein/Boot version
Leiningen 2.9.6 on Java 11.0.14.1 OpenJDK 64-Bit Server VM
Emacs version
GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4) of 2022-03-23
Operating system
Fedora 35
The text was updated successfully, but these errors were encountered: