sebastiencs / company-box

A company front-end with icons
561 stars 64 forks source link

company-box does not obey `completion-ignore-case` #122

Closed stardiviner closed 4 years ago

stardiviner commented 4 years ago

In company-mode, if I set completion-ignore-case to t. I can complete Clojure code (java.lang.System) through input (java.lang.sys). After enabled company-box-mode. This does not work now.

Here is the related issue link https://github.com/clojure-emacs/cider/issues/2895

stardiviner commented 4 years ago

After debug in company-box, I found the bellowing code caused the problem.

(setq company-frontends (->> (delq 'company-pseudo-tooltip-frontend company-frontends)
                             (delq 'company-pseudo-tooltip-unless-just-one-frontend)))
stardiviner commented 4 years ago

Seems company-box-front does not work like company-pseudo-tooltip-frontend.

sebastiencs commented 4 years ago

Hello @stardiviner, I don't understand the issue. The completion itself is handled by company-mode, company-box just display the result. Can you explain a bit more ?

stardiviner commented 4 years ago

@sebastiencs Sorry for my mass messages. ;)

In Clojure code, when I input (java.lang.sys, It should get completion candidates (java.lang.System. But when I have company-box-mode enabled, it does not display this candidate. When I disable company-box-mode, it displays the candidate.

My mistake, I realized the bellowing code in company-box removed some frontends. But company-pseudo-tooltip-frontend can support display the candidate (java.lang.System.

(setq company-frontends (->> (delq 'company-pseudo-tooltip-frontend company-frontends)
                             (delq 'company-pseudo-tooltip-unless-just-one-frontend)))

This is why I guess the problem is in company-box-frontend.

stardiviner commented 4 years ago

Here is a GIF I recorded for demostration.

output

sebastiencs commented 4 years ago

@stardiviner Does it work if you set company-box-show-single-candidate to t

stardiviner commented 4 years ago

It worked. Ahaha, that's great!, thanks @sebastiencs

stardiviner commented 4 years ago

I have a similar question, with input (java.lang.System/getp, I can't complete candidates like (java.lang.System/getProperty?