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
Implement completion style. #54
Comments
Yeah, that'd be awesome. |
+1 Just wondering how this is going. |
I ended up implementing this in If anyone else is interested in using it, I'd be open to splitting it out into its own package. |
I would be very interested in that! After switching from I would expect others would like that too, but never found this package because of the "company" in the name. Ideally this would be added to (By the way, why do you identify the style using the symbol |
Hmm my understanding is that the completion style controls which candidates are considered matches, but doesn't give them an ordering. This is why I named the style I've been hearing a lot about vertico recently, I wonder if I should give it a try. |
I don't know but my guess is that there isn't (yet?). Vertico interacts closely with the default completion mechanism, at least more closely than some alternatives, which has its advantages (things just work) and disadvantages (inherent limitations of the default mechanism are inherited). To be honest I haven't given it too much thought and don't intend to get involved in the whole completion business anytime soon. I am just hoping that one day Of course I understand if you don't want to get involved either. But if you give vertico a try yourself, then it might be worth asking its author about "candidate transformation" or whatever mechanism it might offer for match ordering. |
Would there be a progress on this? I would very likely to set things like (setq completion-styles '(flx)) , etc. |
I implemented it like so in my own config after going through the same troubles as @tarsius .
I tried creating a flx-smart version that doesn't pop up fuzzy matching until the prefix length is long enough but it's probably not too useful yet unless ~~ From casual benchmarking, the initial filtering may take the longest time, sometimes 40ms maybe... e.g.
I also looked at your implementation in company-flx (@PythonNut ) and that seems to work too though I've not tested out the differences that well. I wrote this fairly quickly, so no idea if there are any mistakes (I'm using it now and it seems to work ok.), but happy to PR (or happy to toss this if the company-flx implementation is better) if flx is still being maintained. Otherwise, I will probably create a new package for it. (Also would be happy to understand the delta between the company-flx implementation and my own (I don't really understand it TBH). |
Looking more closely at the company-flx implementation of completion-styles,
I added two print statements ((message "not using all-p") (message "using all-p")) and "not using all-p" was never printed in any of my completing-read functions (the simple ones like find-file, etc) using both selectrum and vertico. That tells me this completion-style (at least for completing-read) is doing the default/simple fuzzy matching (e.g. abc* type matching). When I comment the all-p part out, I start running into completing-read errors, for example, returning (cons string point) will return an error.
So I comment that part out too, and this part also returns an error:
|
Anyways, I've pushed my flx completion-style code to its own repo for the time being now. Hoping I can one day push it to the main flx repo since that's probably the most appropriate place. I'll eventually push to melpa if there're no further discussion on the flx issue. https://github.com/jojojames/flx-completion Can try like so:
|
I've only tested it for a few minutes, but can confirm I can again invoke |
See company-mode/company-mode#47
The text was updated successfully, but these errors were encountered: