Fix unload lifecycle, widget cleanup, and plugin removal handling

- Rename GodotHandler to GDScriptHandler in LSP client
- Fix unload() method naming in nanoesq_temp_buffer plugin
- Return manifest_meta in manifest_manager for manual launch plugins
- Properly destroy tabs_widget, viewport, and scrolled_win on unload
- Refactor plugin removal to search all manifest lists and fix cleanup order
- Fix widget reference in plugins_ui (use child instead of box)
This commit is contained in:
2026-03-23 23:05:20 -05:00
parent e6eaa1d83c
commit cb73f6b3b0
8 changed files with 33 additions and 14 deletions

View File

@@ -56,7 +56,7 @@ class ManifestManager:
if not manifest.autoload:
self.manual_launch_manifests.append(manifest_meta)
return
return manifest_meta
if manifest.pre_launch:
self.pre_launch_manifests.append(manifest_meta)

View File

@@ -48,13 +48,13 @@ class PluginReloadMixin:
def remove_plugin(self, file: str) -> None:
logger.info(f"Removing plugin: {file.get_uri()}")
for manifest_meta in self._plugin_collection[:]:
if not manifest_meta.folder in file.get_uri(): continue
manifest_meta.instance.unload()
manifest_meta.instance = None
self._plugin_collection.remove(manifest_meta)
self.plugins_ui.remove_row(manifest_meta)
manifests = self._manifest_manager.pre_launch_manifests \
+ self._manifest_manager.post_launch_manifests \
+ self._manifest_manager.manual_launch_manifests
for manifest_meta in manifests:
if not manifest_meta.folder in file.get_uri(): continue
if manifest_meta in self._manifest_manager.pre_launch_manifests:
self._manifest_manager.pre_launch_manifests.remove(manifest_meta)
@@ -63,4 +63,15 @@ class PluginReloadMixin:
elif manifest_meta in self._manifest_manager.manual_launch_manifests:
self._manifest_manager.manual_launch_manifests.remove(manifest_meta)
self.plugins_ui.remove_row(manifest_meta)
break
del manifests
for manifest_meta in self._plugin_collection[:]:
if not manifest_meta.folder in file.get_uri(): continue
manifest_meta.instance.unload()
manifest_meta.instance = None
self._plugin_collection.remove(manifest_meta)
break

View File

@@ -76,6 +76,7 @@ class PluginsUI(Gtk.Dialog):
toggle_bttn.toggle_id = \
toggle_bttn.connect("toggled", callback, manifest_meta)
box.toggle_bttn = toggle_bttn
box.add(plugin_lbl)
box.add(author_lbl)
@@ -96,5 +97,5 @@ class PluginsUI(Gtk.Dialog):
toggle_bttn.disconnect(toggle_bttn.toggle_id)
self.list_box.remove(row)
box.destroy()
child.destroy()
break