Skip to content
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

Compliment-like features #10

Open
bbatsov opened this issue Jun 8, 2014 · 12 comments
Open

Compliment-like features #10

bbatsov opened this issue Jun 8, 2014 · 12 comments

Comments

@bbatsov
Copy link
Member

bbatsov commented Jun 8, 2014

In order to provide a similar experience for users of both Clojure and ClojureScript it'd be nice if the completion handling code supported several compliment features:

  • context aware completion
  • fuzzy completion

I guess those should be straightforward to port?

@cichli
Copy link
Member

cichli commented Jun 17, 2014

We can definitely mirror the contextual completion in ns declarations (see ns_mappings.clj in compliment). It'll take a bit of tweaking since ns is a little different in Clojurescript, but it's fundamentally the same.

Fuzzy matching should be easy; we just need to switch out the following line in complete.clj:

(filter #(.startsWith % prefix))

@bbatsov
Copy link
Member Author

bbatsov commented Feb 26, 2015

Well, I'd love to see this for cljs and I know many other people would love to see it as well. :-)

@cichli
Copy link
Member

cichli commented Mar 2, 2015

I actually have a branch with flx-like fuzzy completion (using Damerau-Levenshtein and a QuickSilver-like algorithm) - the problem I encountered is that emacs has completion-styles now, so a lot of the fuzzy matches get filtered out. We'd need a client option to tell CIDER to use its own fuzzy matching and ignore completion-styles.

These algorithms are also inherently tunable - should we let users pick the scoring thresholds? If so it might be best to return all potential candidates to the middleware and have the fuzzy-matching logic there (so the same client settings apply to both clj and cljs).

The other option is to return all potential candidates to emacs and let completion-styles filter them, but some caching would need to occur. It's noticeably sluggish if the backend returns all potential candidates that often. Even with caching, doing flx-like matching in emacs is probably too slow regardless - see company-mode/company-mode#47 - so I think this option is out (unless you think the built-in initials completion style is good enough).

@cichli
Copy link
Member

cichli commented Mar 2, 2015

I will work on the ns-form / locals contextual completion, though :-).

@bbatsov
Copy link
Member Author

bbatsov commented Mar 3, 2015

We'd need a client option to tell CIDER to use its own fuzzy matching and ignore completion-styles.

Makes sense to me.

These algorithms are also inherently tunable - should we let users pick the scoring thresholds? If so it might be best to return all potential candidates to the middleware and have the fuzzy-matching logic there (so the same client settings apply to both clj and cljs).

I'd suggest keeping things simple and just returning whatever compliment and cljs-tooling are computing. Perhaps we can adjust this down the road.

The other option is to return all potential candidates to emacs and let completion-styles filter them, but some caching would need to occur. It's noticeably sluggish if the backend returns all potential candidates that often. Even with caching, doing flx-like matching in emacs is probably too slow regardless - see company-mode/company-mode#47 - so I think this option is out (unless you think the built-in initials completion style is good enough).

I'm definitely not a fan of this approach.

@bbatsov
Copy link
Member Author

bbatsov commented Mar 3, 2015

Btw, a related ticket clojure-emacs/cider#467

@cichli
Copy link
Member

cichli commented Mar 5, 2015

@bbatsov I'll rebase the fuzzy-completion branch once #16 is merged.

@bbatsov
Copy link
Member Author

bbatsov commented Dec 12, 2015

Any progress here?

@bbatsov
Copy link
Member Author

bbatsov commented Jan 8, 2017

I guess not. :-)

@dpsutton
Copy link

dpsutton commented Jan 8, 2017

@cichli is there any chance you still have this branch?

@bbatsov
Copy link
Member Author

bbatsov commented Jan 8, 2017

Likely this is the only commit in this branch - cichli@352f42c

@MalloZup
Copy link

MalloZup commented Aug 5, 2019

autogenerated with https://github.com/MalloZup/doghub: issue inactive since 450 days. Please update the issue or close it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants