feat: Complete plugin lifecycle management with lazy loading and runtime reload
Major changes: - Add unload() method to all plugins for proper cleanup (unregister commands/providers/LSP clients, destroy widgets, clear state) - Implement lazy widget loading via "show" signal across all containers - Add autoload: false manifest option for manual/conditional plugin loading - Add Plugins UI with runtime load/unload toggle via Ctrl+Shift+p - Implement controller unregistration system with proper signal disconnection - Add new events: UnregisterCommandEvent, GetFilesEvent, GetSourceViewsEvent, TogglePluginsUiEvent - Fix signal leaks by tracking and disconnecting handlers in widgets (search/replace, LSP manager, tabs, telescope, markdown preview) - Add Save/Save As to tabs context menu - Improve search/replace behavior (selection handling, focus management) - Add telescope file initialization from existing loaded files - Refactor plugin reload watcher to dynamically add/remove plugins on filesystem changes - Add new plugins: file_history, extend_source_view_menu, godot_lsp_client - Fix bug in prettify_json (undefined variable reference)
This commit is contained in:
@@ -19,10 +19,12 @@ class ManifestMapperException(Exception):
|
||||
class ManifestManager:
|
||||
def __init__(self):
|
||||
|
||||
self._plugins_path = settings_manager.path_manager.get_plugins_path()
|
||||
self._plugins_path: str = \
|
||||
settings_manager.path_manager.get_plugins_path()
|
||||
|
||||
self.pre_launch_manifests: list = []
|
||||
self.post_launch_manifests: list = []
|
||||
self.pre_launch_manifests: list = []
|
||||
self.post_launch_manifests: list = []
|
||||
self.manual_launch_manifests: list = []
|
||||
|
||||
self.load_manifests()
|
||||
|
||||
@@ -37,7 +39,7 @@ class ManifestManager:
|
||||
]:
|
||||
self.load(folder, path)
|
||||
|
||||
def load(self, folder, path):
|
||||
def load(self, folder, path) -> ManifestMeta:
|
||||
manifest_pth = join(path, "manifest.json")
|
||||
|
||||
if not os.path.exists(manifest_pth):
|
||||
@@ -52,14 +54,22 @@ class ManifestManager:
|
||||
manifest_meta.path = path
|
||||
manifest_meta.manifest = manifest
|
||||
|
||||
if not manifest.autoload:
|
||||
self.manual_launch_manifests.append(manifest_meta)
|
||||
return
|
||||
|
||||
if manifest.pre_launch:
|
||||
self.pre_launch_manifests.append(manifest_meta)
|
||||
else:
|
||||
self.post_launch_manifests.append(manifest_meta)
|
||||
|
||||
def get_pre_launch_plugins(self) -> dict:
|
||||
return manifest_meta
|
||||
|
||||
def get_pre_launch_plugins(self) -> list:
|
||||
return self.pre_launch_manifests
|
||||
|
||||
def get_post_launch_plugins(self) -> None:
|
||||
def get_post_launch_plugins(self) -> list:
|
||||
return self.post_launch_manifests
|
||||
|
||||
def get_manual_launch_plugins(self) -> list:
|
||||
return self.manual_launch_manifests
|
||||
|
||||
Reference in New Issue
Block a user