vscode-snippet
vscode-snippet copied to clipboard
Implement new live-suggestion feature of cheat.sh
In #5, @chubin mentioned a new interface for live suggestions in cheat.sh:
$ curl cheat.sh/python/create+empty?query=complete
create empty list
create empty array
create empty file
create empty dict
create empty set
(See here: https://github.com/mre/vscode-snippet/issues/5#issuecomment-430407443)
This is a tracking ticket for this feature. As soon as it becomes available, we should add it to vscode-snippet, as it provides a lot of value in my opinion.
On that note, we also might want to add a "suggestion delay" config variable, which indicates how long vscode-snippet is going to wait before sending a query to cheat.sh.
@mre Why do you think that we need a delay here? Why don't you want to send a query immediately?
My reasoning was that I want to avoid overloading the server, but maybe I was a bit too conservative here. Let's try without a delay and go from there.
Currently, VS Code does not provide the needed API for this functionality, See https://github.com/microsoft/vscode/issues/21372
The last comment in the linked issue mentions the new QuickPick API. https://github.com/microsoft/vscode/issues/21372#issuecomment-419864437 Maybe that can help us?
Looks like it was done here? https://github.com/KnisterPeter/vscode-github/pull/234/files