Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ivy-completion-in-region does not call completion-extra-properties :exit-function #1489

Closed
rslack opened this issue Mar 15, 2018 · 4 comments

Comments

@rslack
Copy link

commented Mar 15, 2018

When a completion-at-point function includes an :exit-function or :annotation-function in the props, ivy-completion-in-region does not call either.

If this is intentional, is there some other more ivy way to accomplish the same things?

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Mar 16, 2018

Please link an example / purpose of :exit-function and :annotation-function.

@tarsius

This comment has been minimized.

Copy link
Contributor

commented Jul 27, 2018

I would like to use it like so:

(defun forge-issue-completion-at-point ()
  (when-let ((repo t)) ; not used by the dummy: (forge-get-repository nil)))
    (when (looking-back "#\\([0-9]*\\)" (- (point) 8))
      (list (match-beginning 1)
            (match-end 0)
            (mapcar (lambda (row)
                      (propertize (number-to-string (car row))
                                  :title (cadr row)))
                    ;; (forge-sql [:select [number title] :from issue
                    ;;             :where (= repository $s1)
                    ;;             :order-by [(desc number)]]
                    ;;            (oref repo id)))
                    ;; Okay that isn't available yet, so a dummy:
                    '((1 "Something is broken, help!")
                      (2 "Please implement this")))
            :exclusive 'no
            :annotation-function (lambda (c) (get-text-property 0 :title c))))))
Add new feature

Closes #
        1 Something is broken, help!
	2 Please implement this

@abo-abo abo-abo closed this in 951560e Jul 27, 2018

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Jul 27, 2018

@tarsius Thanks for the example. It should now work.

@tarsius

This comment has been minimized.

Copy link
Contributor

commented Jul 27, 2018

Thanks! Works as expected.

basil-conto added a commit to basil-conto/swiper that referenced this issue Aug 6, 2018
ivy.el: Fontify completion annotations
(ivy--format-minibuffer-line): Apply completions-annotations face to
result of :annotation-function.

Re: abo-abo#1489
abo-abo added a commit that referenced this issue Aug 6, 2018
ivy.el: Fontify completion annotations
(ivy--format-minibuffer-line): Apply completions-annotations face to
result of :annotation-function.

Re: #1489
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.