Make cider completion work with corfu
This commit is contained in:
parent
c3ad45ac28
commit
8de452cf89
|
@ -135,6 +135,20 @@
|
|||
(unbind-key "C-c C-l" cider-mode-map)
|
||||
(unbind-key "C-c C-b" cider-mode-map)
|
||||
(unbind-key "C-c C-b" cider-repl-mode-map)
|
||||
|
||||
;; https://github.com/clojure-emacs/cider/issues/3019#issuecomment-1330342147
|
||||
(defun my/cider-complete-at-point ()
|
||||
"Complete the symbol at point."
|
||||
(when (and (cider-connected-p)
|
||||
(not (cider-in-string-p)))
|
||||
(when-let* ((bounds (bounds-of-thing-at-point 'symbol))
|
||||
(beg (car bounds))
|
||||
(end (cdr bounds))
|
||||
(completion (append (cider-complete (buffer-substring beg end))
|
||||
(get-text-property (point) 'cider-locals))))
|
||||
(list beg end (completion-table-dynamic (lambda (_) completion))
|
||||
:annotation-function #'cider-annotate-symbol))))
|
||||
(advice-add 'cider-complete-at-point :override 'my/cider-complete-at-point)
|
||||
:bind
|
||||
(:map cider-mode-map
|
||||
("C-c M-l" . cider-load-file)
|
||||
|
|
Loading…
Reference in New Issue