Skip to content

Commit

Permalink
Support "variants" in company-capf
Browse files Browse the repository at this point in the history
  • Loading branch information
dgutov committed Oct 25, 2023
1 parent 7da7869 commit b965dfa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions company-capf.el
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ so we can't just use the preceding variable instead.")

(defvar-local company-capf--sorted nil)

(defun company-capf (command &optional arg &rest _args)
(defun company-capf (command &optional arg &rest rest)
"`company-mode' backend using `completion-at-point-functions'."
(interactive (list 'interactive))
(pcase command
Expand Down Expand Up @@ -145,21 +145,25 @@ so we can't just use the preceding variable instead.")
(`meta
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
:company-docsig)))
(when f (funcall f arg))))
(when f (apply f arg rest))))
(`doc-buffer
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
:company-doc-buffer)))
(when f (funcall f arg))))
(when f (apply f arg rest))))
(`location
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
:company-location)))
(when f (funcall f arg))))
(when f (apply f arg rest))))
(`annotation
(company-capf--annotation arg))
(`kind
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
:company-kind)))
(when f (funcall f arg))))
(`variants
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
:company-variants)))
(when f (funcall f arg))))
(`deprecated
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
:company-deprecated)))
Expand Down

0 comments on commit b965dfa

Please sign in to comment.