redguardtoo / company-ctags

Fastest Emacs auto-completion using Company and Ctags
GNU General Public License v3.0
56 stars 3 forks source link

Support non-prefix completion? #2

Closed AmaiKinono closed 4 years ago

AmaiKinono commented 4 years ago

Let me explain my workflow first: I only use company-dabbrev or company-dabbrev-code as my backend. They are efficient, since for a symbol, I only need to type the full name once.

When I can't remember the exact name of a symbol (like when typing it for the first time), I use this command

(defun my-counsel-company ()
  (interactive)
  (company-abort)
  (let ((company-backends '(company-capf)))
    (call-interactively 'counsel-company)))

What's really good about company-capf is it supports non-prefix completion. Like if there's a symbol called some-long-function-name and I don't remember it starts with some, I can type function first, then further filter the results:

counsel-company

Now I'm trying out company-ctags (assuming it's very suitable for large projects), but found it doesn't support non-prefix completion, which matters a lot to me. Could we make this happen?

redguardtoo commented 4 years ago

What's counsel-company?

I can give you a boolean flag company-ctags-no-prefix-completion-p, Is it OK for you?

AmaiKinono commented 4 years ago

It's a company frontend offerd by counsel. Basically you type your prefix, call this, then you can use ivy to do all sorts of filtering in the candidates, so I found it to be very handy with backends that support non-prefix completion.

I can give you a boolean flag company-ctags-no-prefix-completion-p

I don' quite understand. Is it a user option or a probe?

redguardtoo commented 4 years ago

It's a user option.

AmaiKinono commented 4 years ago

It's a user option.

That's exactly what I want.

redguardtoo commented 4 years ago

9ee04b1 can fuzzy match candidates (Chen Bin)

AmaiKinono commented 4 years ago

This works. Thanks!