diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 50ff27f08..77393a19a 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -22,7 +22,7 @@ namespace Flow.Launcher.Core.Plugin public static List AllPlugins { get; private set; } public static readonly HashSet GlobalPlugins = new(); - public static readonly Dictionary NonGlobalPlugins = new (); + public static readonly Dictionary NonGlobalPlugins = new(); public static IPublicAPI API { private set; get; } @@ -33,7 +33,10 @@ namespace Flow.Launcher.Core.Plugin /// /// Directories that will hold Flow Launcher plugin directory /// - private static readonly string[] Directories = { Constant.PreinstalledDirectory, DataLocation.PluginsDirectory }; + private static readonly string[] Directories = + { + Constant.PreinstalledDirectory, DataLocation.PluginsDirectory + }; private static void DeletePythonBinding() { @@ -100,7 +103,7 @@ namespace Flow.Launcher.Core.Plugin try { var milliseconds = await Stopwatch.DebugAsync($"|PluginManager.InitializePlugins|Init method time cost for <{pair.Metadata.Name}>", - () => pair.Plugin.InitAsync(new PluginInitContext(pair.Metadata, API))); + () => pair.Plugin.InitAsync(new PluginInitContext(pair.Metadata, API))); pair.Metadata.InitTime += milliseconds; Log.Info( @@ -149,7 +152,10 @@ namespace Flow.Launcher.Core.Plugin if (NonGlobalPlugins.ContainsKey(query.ActionKeyword)) { var plugin = NonGlobalPlugins[query.ActionKeyword]; - return new List { plugin }; + return new List + { + plugin + }; } else { @@ -220,7 +226,7 @@ namespace Flow.Launcher.Core.Plugin public static List GetContextMenusForPlugin(Result result) { - var results = new List(); + List results; var pluginPair = _contextMenuPlugins.FirstOrDefault(o => o.Metadata.ID == result.PluginID); if (pluginPair != null) { @@ -228,7 +234,7 @@ namespace Flow.Launcher.Core.Plugin try { - results = plugin.LoadContextMenus(result); + results = plugin.LoadContextMenus(result) ?? new List(); foreach (var r in results) { r.PluginDirectory = pluginPair.Metadata.PluginDirectory; @@ -305,4 +311,4 @@ namespace Flow.Launcher.Core.Plugin } } } -} +} \ No newline at end of file