Use cape super capf to keep tempel together with eglot completion

This commit is contained in:
Evie Litherland-Smith 2024-02-22 11:08:50 +00:00
parent c318479bed
commit c61a502f2b
2 changed files with 14 additions and 3 deletions

View file

@ -36,7 +36,9 @@
:custom
(completion-styles '(orderless basic))
(completion-category-defaults nil)
(completion-category-overrides '((file (styles . (partial-completion))))))
(completion-category-overrides '((file (styles . (partial-completion)))
(eglot (styles . (styles orderless)))
(eglot-capf (styles . (styles orderless))))))
#+end_src
* Corfu and Cape

View file

@ -70,7 +70,7 @@ Set treesit to fontify all elements, default was 3 (out of 4)
f90-mode
js-ts-mode)
. eglot-ensure)
(eglot-managed-mode . (lambda () (add-to-list 'flymake-diagnostic-functions #'eglot-flymake-backend))))
(eglot-managed-mode . (lambda () (add-to-list 'flymake-diagnostic-functions #'eglot-flymake-backend t))))
:custom
(eglot-extend-to-xref t)
(eglot-autoshutdown t)
@ -94,7 +94,16 @@ Set treesit to fontify all elements, default was 3 (out of 4)
:flake
( :autoArchive t
:autoEvalInputs t
:nixpkgsInputName "nixpkgs"))))))
:nixpkgsInputName "nixpkgs")))))
(with-eval-after-load 'cape
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
(defun my/eglot-capf ()
(setq-local completion-at-point-functions
(list (cape-capf-super
#'eglot-completion-at-point
#'tempel-expand
#'cape-file))))
(add-hook 'eglot-managed-mode-hook #'my/eglot-capf)))
#+end_src
* Apheleia formatting