Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Flow.Launcher.Core/Plugin/PluginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

// We should not initialize API in static constructor because it will create another API instance
private static IPublicAPI api = null;
private static IPublicAPI API => api ??= Ioc.Default.GetRequiredService<IPublicAPI>();

Check warning on line 36 in Flow.Launcher.Core/Plugin/PluginManager.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Ioc` is not a recognized word. (unrecognized-spelling)

private static PluginsSettings Settings;
private static List<PluginMetadata> _metadatas;
Expand Down Expand Up @@ -111,7 +111,7 @@
await Task.WhenAll(AllPlugins.Select(plugin => plugin.Plugin switch
{
IReloadable p => Task.Run(p.ReloadData),
IAsyncReloadable p => p.ReloadDataAsync(),

Check warning on line 114 in Flow.Launcher.Core/Plugin/PluginManager.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Reloadable` is not a recognized word. (unrecognized-spelling)
_ => Task.CompletedTask,
}).ToArray());
}
Expand Down Expand Up @@ -173,12 +173,12 @@
/// <param name="settings"></param>
public static void LoadPlugins(PluginsSettings settings)
{
_metadatas = PluginConfig.Parse(Directories);

Check warning on line 176 in Flow.Launcher.Core/Plugin/PluginManager.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`metadatas` is not a recognized word. (unrecognized-spelling)
Settings = settings;
Settings.UpdatePluginSettings(_metadatas);

Check warning on line 178 in Flow.Launcher.Core/Plugin/PluginManager.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`metadatas` is not a recognized word. (unrecognized-spelling)
AllPlugins = PluginsLoader.Plugins(_metadatas, Settings);

Check warning on line 179 in Flow.Launcher.Core/Plugin/PluginManager.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`metadatas` is not a recognized word. (unrecognized-spelling)
// Since dotnet plugins need to get assembly name first, we should update plugin directory after loading plugins
UpdatePluginDirectory(_metadatas);

Check warning on line 181 in Flow.Launcher.Core/Plugin/PluginManager.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`metadatas` is not a recognized word. (unrecognized-spelling)
}

private static void UpdatePluginDirectory(List<PluginMetadata> metadatas)
Expand Down Expand Up @@ -700,6 +700,14 @@
}
Settings.RemovePluginSettings(plugin.ID);
AllPlugins.RemoveAll(p => p.Metadata.ID == plugin.ID);
foreach (var globalPlugin in GlobalPlugins.Where(p => p.Metadata.ID == plugin.ID))
{
GlobalPlugins.Remove(globalPlugin);
}
foreach (var key in NonGlobalPlugins.Where(p => p.Value.Metadata.ID == plugin.ID).Select(p => p.Key))
{
NonGlobalPlugins.Remove(key);
}
}

// Marked for deletion. Will be deleted on next start up
Expand Down
Loading