iquiw / company-ghc

Company-mode completion back-end for haskell-mode via ghc-mod
125 stars 6 forks source link

Fuzzy match for module names #13

Closed rpglover64 closed 9 years ago

rpglover64 commented 9 years ago

I'd like to be able to type something like C.M.Re and get Control.Monad.Reader. Or rather, C.M and have Control.Monad show up in the completion list.

If I understood the code correctly, this requires us not to use all-completions.

iquiw commented 9 years ago

Thanks for the suggestion. It looks to me something like abbrev expansion rather than fuzzy match in general sense.

If I understood the code correctly, this requires us not to use all-completions.

I think matching itself is possible with all-completions by specifying proper PREDICATE function as the 3rd argument. But IIRC, there needs some work if inputted prefix and matched text are different. I will check it.

iquiw commented 9 years ago

@rpglover64 I pushed the change to module-prefix-match branch.

I'd like to be able to type something like C.M.Re and get Control.Monad.Reader. Or rather, C.M and have Control.Monad show up in the completion list.

It supports the above cases, but "C.M" matches with "Control.Monad.Reader" also.

iquiw commented 9 years ago

Merged to master. Enabled by setting company-ghc-component-prefix-match to t.