mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix(coq): corfu integration
Makes company-coq cooperate wtih Corfu without activating company-mode. Needs more testing.
This commit is contained in:
@ -79,13 +79,25 @@
|
|||||||
|
|
||||||
(setq company-coq-disabled-features '(hello company-defaults spinner))
|
(setq company-coq-disabled-features '(hello company-defaults spinner))
|
||||||
|
|
||||||
(if (modulep! :completion company)
|
(cond ((modulep! :completion corfu)
|
||||||
(define-key coq-mode-map [remap company-complete-common]
|
;; HACK: company-coq activates `company-mode', though it's not really
|
||||||
#'company-indent-or-complete-common)
|
;; needed when we're relying on Corfu, hence these hacks:
|
||||||
;; `company-coq''s company defaults impose idle-completion on folks, so
|
(add-hook! 'coq-mode-local-vars-hook
|
||||||
;; we'll set up company ourselves. See
|
(defun +coq-init-capf-completion-h ()
|
||||||
;; https://github.com/cpitclaudel/company-coq/issues/42
|
(when (bound-and-true-p company-mode)
|
||||||
(add-to-list 'company-coq-disabled-features 'company))
|
(company-mode -1))
|
||||||
|
(add-hook 'completion-at-point-functions
|
||||||
|
(cape-company-to-capf 'company-coq)
|
||||||
|
nil t)))
|
||||||
|
(defadvice! +coq--proof-goto-point-advice (&rest _)
|
||||||
|
:override #'company-coq--proof-goto-point-advice
|
||||||
|
(when (bound-and-true-p company-candidates)
|
||||||
|
(company-abort))))
|
||||||
|
|
||||||
|
;; DEPRECATED: The company module is deprecated.
|
||||||
|
((modulep! :completion company)
|
||||||
|
(define-key coq-mode-map [remap company-complete-common]
|
||||||
|
#'company-indent-or-complete-common)))
|
||||||
|
|
||||||
;; HACK: Doom treats the use of package.el and its API as user error unless
|
;; HACK: Doom treats the use of package.el and its API as user error unless
|
||||||
;; they've called `package-initialize' themselves (in which case, it is
|
;; they've called `package-initialize' themselves (in which case, it is
|
||||||
|
Reference in New Issue
Block a user