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

Provide live suggestions for user input #5

Closed
mre opened this issue Jul 25, 2018 · 7 comments
Closed

Provide live suggestions for user input #5

mre opened this issue Jul 25, 2018 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mre
Copy link
Owner

mre commented Jul 25, 2018

We should have an option for suggesting snippets while a user is typing a query.
Gitlens provides the same functionality.

See https://github.com/eamodio/vscode-gitlens

@mre mre added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 25, 2018
@GianOrtiz
Copy link
Collaborator

I would like to work on this one, but I have one question about this feature, this will display suggestions based on user previous queries or in the content displayed by cht.sh/:list?

@mre
Copy link
Owner Author

mre commented Oct 16, 2018

Both options are interesting.

I would start with suggestions from previous searches.
We can cache them somehow (e.g. in a trie if we want to be fancy) and then show a list of previous searches.

Once we have that nailed down, we could add live suggestions for keywords. I.e. if the user starts typing sli and we are currently in a Golang file, it could suggest slice and sleep.

As far as I can see, cheat.sh doesn't have support for suggestions yet, right @chubin? Shall I create an issue for that, or is it out of the scope for the project? Alternatively, we could query StackOverflow.

Thanks for raising those points @GianOrtiz. If you want, you could try adding suggestions based on previous searches for a start. 😊

@chubin
Copy link

chubin commented Oct 16, 2018

Actually, we are already working on that and we are already quite far.
The idea is to analyze historical queries to the service and provide
possible suggestions basing on that.

We are experimenting with a naive prefix based approach (based on the historical queries solely),
and with a more sophisticated, HMM-based approach (based on the historical queries and the answers combined). The latter gives better results, but still not yet fully satisfying.

The interface will look like:

$ curl cheat.sh/python/create+empty?query=complete
create empty list
create empty array
create empty file
create empty dict
create empty set

@mre
Copy link
Owner Author

mre commented Oct 17, 2018

That's nice. Is there an issue to track so that we know when it's ready? Alternatively, just ping me and I'll update this issue here. Thanks for working on that; looks promising.

@chubin
Copy link

chubin commented Oct 17, 2018

As soon as we have something to test, I will ping you here.

@GianOrtiz
Copy link
Collaborator

This issue will be closed and once the feature #5 (comment) is ready to test another issue will be opened? Or we can continue the implementation of live suggestion using the user's past searches, saved in cache, @mre?

@mre
Copy link
Owner Author

mre commented Oct 17, 2018

Or we can continue the implementation of live suggestion using the user's past searches, saved in cache, @mre?

Absolutely. We can just use this issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants