Add action keywords for each plugin (#6129)

* Add action keywords for each plugin

- Added keywords for each plug-in
-  Change window walker search to use Query, not RawQuery (to get rid of action keyword)
- Make sure plug-ins that have action keywords as well as are in global list don't get added twice

All tests passed that passed before I started

Addressing issue #5823

* Fix bad formatting from the merge

* Do not add global plug-ins if we have an action keyword

Note side effect: you will not not be able to search for things that start with one of the plug-in keywords.

* Missed merge conflict repair!

* Revert "Do not add global plug-ins if we have an action keyword"

This reverts commit e3b0ecd708.

* Adjust keywords to suggested ones

* No need to ubild a query if we aren't going to use it

Didn't quite get the if statement right the first time I put it in.

* Do not add global plugins if we have an action keyword

This means, especially without a space, that global plugins do not become part of the search. Which really narrows down the search results, nicely.

* Update keywords as requested in the PR
This commit is contained in:
Gordon Watts 2020-10-19 10:42:01 -07:00 committed by GitHub
parent 12a84c01b1
commit 4660dd4970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 20 additions and 12 deletions

View File

@ -1,6 +1,6 @@
{ {
"ID":"CEA0FDFC6D3B4085823D60DC76F28855", "ID":"CEA0FDFC6D3B4085823D60DC76F28855",
"ActionKeyword":"*", "ActionKeywords": [ "*", "=" ],
"Name":"Calculator", "Name":"Calculator",
"Description":"Provide mathematical calculations.(Try 5*3-2 in PowerToys)", "Description":"Provide mathematical calculations.(Try 5*3-2 in PowerToys)",
"Author":"cxfksword", "Author":"cxfksword",

View File

@ -1,6 +1,6 @@
{ {
"ID":"B4D3B69656E14D44865C8D818EAE47C4", "ID":"B4D3B69656E14D44865C8D818EAE47C4",
"ActionKeyword":"*", "ActionKeyword": "*",
"Name":"Folder", "Name":"Folder",
"Description":"Searcn and open folders", "Description":"Searcn and open folders",
"Author":"qianlifeng", "Author":"qianlifeng",

View File

@ -1,6 +1,6 @@
{ {
"ID": "2140FC9819AD43A3A616E2735815C27C", "ID": "2140FC9819AD43A3A616E2735815C27C",
"ActionKeyword": "*", "ActionKeywords": [ "*", "?" ],
"Name": "Windows Indexer", "Name": "Windows Indexer",
"Description": "Search for files and folders", "Description": "Search for files and folders",
"Author": "Microsoft", "Author": "Microsoft",

View File

@ -1,6 +1,6 @@
{ {
"ID":"791FC278BA414111B8D1886DFE447410", "ID":"791FC278BA414111B8D1886DFE447410",
"ActionKeyword":"*", "ActionKeywords": [ "*", "."],
"Name":"Program", "Name":"Program",
"Description":"Search for programs", "Description":"Search for programs",
"Author":"qianlifeng", "Author":"qianlifeng",

View File

@ -1,6 +1,6 @@
{ {
"ID": "03276A39D4E9417C8FFD200B0EE5E871", "ID": "03276A39D4E9417C8FFD200B0EE5E871",
"ActionKeyword": "*", "ActionKeywords": [ "*", "//" ],
"Name": "Windows Uri Handler", "Name": "Windows Uri Handler",
"Description": "Handles urls", "Description": "Handles urls",
"Author": "Microsoft", "Author": "Microsoft",

View File

@ -32,7 +32,7 @@ namespace Microsoft.Plugin.WindowWalker
} }
OpenWindows.Instance.UpdateOpenWindowsList(); OpenWindows.Instance.UpdateOpenWindowsList();
SearchController.Instance.UpdateSearchText(query.RawQuery).Wait(); SearchController.Instance.UpdateSearchText(query.Search).Wait();
return _results.Select(x => new Result() return _results.Select(x => new Result()
{ {

View File

@ -1,6 +1,6 @@
{ {
"ID":"F737A9223560B3C6833B5FFB8CDF78E5", "ID":"F737A9223560B3C6833B5FFB8CDF78E5",
"ActionKeyword":"*", "ActionKeywords": [ "*", "<"],
"Name":"Window Walker", "Name":"Window Walker",
"Description":"Alt-Tab alternative enabling searching through your windows.", "Description":"Alt-Tab alternative enabling searching through your windows.",
"Author":"betadele", "Author":"betadele",

View File

@ -59,12 +59,20 @@ namespace Wox.Core.Plugin
} }
} }
var globalplugins = PluginManager.GlobalPlugins; // If the user has specified a matching action keyword, then do not
// add the global plugins to the list.
foreach (PluginPair globalPlugin in PluginManager.GlobalPlugins) if (pluginQueryPair.Count == 0)
{ {
var query = new Query(rawQuery, rawQuery, terms, string.Empty); var globalplugins = PluginManager.GlobalPlugins;
pluginQueryPair.Add(globalPlugin, query);
foreach (PluginPair globalPlugin in PluginManager.GlobalPlugins)
{
if (!pluginQueryPair.ContainsKey(globalPlugin))
{
var query = new Query(rawQuery, rawQuery, terms, string.Empty);
pluginQueryPair.Add(globalPlugin, query);
}
}
} }
return pluginQueryPair; return pluginQueryPair;