Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 253 forks source link

Add rtags-completion-at-point #810

Open abo-abo opened 8 years ago

abo-abo commented 8 years ago

Emacs has C-M-i bound to completion-at-point. I found it to be a pretty cool interface, since it decouples the list of strings part (completion-at-point-functions) and the completion display part (completion-in-region-function).

Would be nice to be able to hook up rtags like this:

(setq completion-at-point-functions '(rtags-completion-at-point))

Here's my tentative implementation of rtags-completion-at-p:

(defun rtags-completion-at-point ()
  (when (and (company-manual-begin)
             (looking-back company-common (line-beginning-position)))
    (list
     (match-beginning 0)
     (match-end 0)
     company-candidates)))

The interface is quite simple: has to return a list of

  1. Symbol start position.
  2. Symbol end position.
  3. List of strings - the possible completions for the symbol.

Currently, I can't figure out how to make rtags-completion-at-point not depend on company; I got lost in the callbacks:)

Could you implement this function for rtags.el? I'm sure many users would appreciate the ability to complete Rtags with Ivy/Helm/Ido etc, instead of just auto-complete and company.

Andersbakken commented 8 years ago

Hi Oleh

I'll add this to rtags-company.el for now and try to disentangle it from company in the future.

Thanks

Anders

On Fri, Sep 30, 2016 at 9:12 AM, Oleh Krehel notifications@github.com wrote:

Emacs has C-M-i bound to completion-at-point. I found it to be a pretty cool interface, since it decouples the list of strings part ( completion-at-point-functions) and the completion display part ( completion-in-region-function).

Would be nice to be able to hook up rtags like this:

(setq completion-at-point-functions '(rtags-completion-at-point))

Here's my tentative implementation of rtags-completion-at-p:

(defun rtags-completion-at-point () (when (and (company-manual-begin) (looking-back company-common (line-beginning-position))) (list (match-beginning 0) (match-end 0) company-candidates)))

The interface is quite simple: has to return a list of

  1. Symbol start position.
  2. Symbol end position.
  3. List of strings - the possible completions for the symbol.

Currently, I can't figure out how to make rtags-completion-at-point not depend on company; I got lost in the callbacks:)

Could you implement this function for rtags.el? I'm sure many users would appreciate the ability to complete Rtags with Ivy/Helm/Ido etc, instead of just auto-complete and company.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Andersbakken/rtags/issues/810, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEdSrqxcC7JUz6lvEZflvqIUAzgJ7zFks5qvTT_gaJpZM4KLQdj .

abo-abo commented 8 years ago

Thanks.

tee3 commented 8 years ago

+1 on decoupling. I looked at this in regards to adding support ido and maybe xref (in Emacs 25.1), but gave up. @Andersbakken Can you recommend somewhere to start disentangling?

juergenhoetzel commented 6 years ago

Is somebody working on this issue?

casch-at commented 6 years ago

Hey Jürgen!

AFAIK, nobody is working on that.

Are you interested in resolving this issue?

Christian Jürgen Hötzel notifications@github.com writes:

Is somebody working on this issue?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

juergenhoetzel commented 6 years ago

Are you interested in resolving this issue?

Yes, I was hoping someone had already a branch on this topic.

casch-at commented 6 years ago

Unfortunately not. I can assign you to this issue, if you like?

Jürgen Hötzel notifications@github.com writes:

Are you interested in resolving this issue?

Yes, I was hoping someone had already a branch on this topic.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

juergenhoetzel commented 6 years ago

Unfortunately not. I can assign you to this issue, if you like?

I can't cannot guarantee working on this in the near future. Better to be up for grabs :pray: