-
-
Notifications
You must be signed in to change notification settings - Fork 445
Improvements for re-queries #2174
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
Conversation
When a plugin is processing a query, it can check the `IsForced` property to decide if the results will be served from cache or not.
Interesting, but I also remember that f5 acts like reload plugin data? Will the two feature overlap? |
This is not the same... as far as I understand So, in terms of my example above, |
This is a very useful feature. It would be nice if plugins could control how long the cache of results lasts. 🤔 |
Sounds very useful. I am only a little bit worrying whether users may get confused between these two. |
I doubt many users even know about F5 |
Does F5 call If yes, is it common for a user to want to do that frequently? I understand why a user might want to trigger a |
The reload data function provides an interface for plugins, when implemented they can write their own method of reloading their data. It is a call to all plugins that implemented the interface. It is used for users that want to manually trigger a reload to update their plugin data. For example I don't think the PluginsManager has it implemented, if not I actually want to add it so we can press F5 and have the manifest manually updated. It is async operation so from my experience all plugins finish very fast within a sec or two, I haven't had a chance to look at the code in this PR but I think instead of introducing a new hotkey, can the plugin not just use the reload interface to refresh cache? |
We need to update readme + docs, will do this separately. |
This quick PR introduces the following changes:
IsReQuery
property is added to theQuery
class, which will be set totrue
whenever a Query is re-executed.Ctrl + R
key binding is added for quickly re-executing the current query.This enables
Ctrl + R
to act as a "refresh" mechanism. When users type a query and the shown results seem out-of-date (for example, due to caching), they can hitCtrl + R
to get fresh results.Example use-case
The Github plugin caches all query results to avoid rate-limits (and because the Github API is pretty slow). When the user tries to list the issues for a repository, they are likely to get cached results, and therefore recently created issues may be missing.
Ctrl + R
can be used to signal the plugin to skip the cache and load the repository's issues from the API.TODO: update readme + docs