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
Closed

Comments

@rslack
Copy link

@rslack rslack 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
Copy link
Owner

@abo-abo abo-abo commented Mar 16, 2018

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

Loading

@tarsius
Copy link
Contributor

@tarsius tarsius 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

Loading

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

@abo-abo abo-abo commented Jul 27, 2018

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

Loading

@tarsius
Copy link
Contributor

@tarsius tarsius commented Jul 27, 2018

Thanks! Works as expected.

Loading

basil-conto added a commit to basil-conto/swiper that referenced this issue Aug 6, 2018
(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--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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants