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)
2026-03-21 13:22:20 -05:00
|
|
|
# Python imports
|
|
|
|
|
|
|
|
|
|
# Lib imports
|
|
|
|
|
import gi
|
feat: improve LSP lifecycle, terminal widget, and code folding support
- LSP:
- Add shutdown and exit request/notification handling
- Send initialized notification after initialize response
- Gracefully close clients with delayed shutdown via GLib timeout
- Fix LSP WS server ↔ Godot LSP communication flow
- Terminal (VteWidget):
- Switch to async spawn with full environment inheritance
- Add PROMPT_COMMAND OSC7 support for cwd tracking
- Improve UX: scrollback, no audible bell, auto scroll
- Implement clipboard shortcuts, selection copy, middle-click paste
- Track cwd changes and update UI label
- Add proper signal wiring and cleanup on destroy
- Code folding:
- Add fold support for JS, HTML, CSS, JSON, C, C++, Go
- Reset fold state safely when AST or filetype is unavailable
- UI (Plugins dialog):
- Improve dialog behavior (non-modal, centered, transient)
- Add focus-out auto-hide and Ctrl+Shift+P shortcut
- Misc:
- Add type hints in VTE widget
- Update TODOs (remove completed items, add LSP comm fix)
- Add terminal plugin scaffolding
2026-04-13 00:50:42 -05:00
|
|
|
gi.require_version('Gdk', '3.0')
|
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)
2026-03-21 13:22:20 -05:00
|
|
|
from gi.repository import Gtk
|
feat: improve LSP lifecycle, terminal widget, and code folding support
- LSP:
- Add shutdown and exit request/notification handling
- Send initialized notification after initialize response
- Gracefully close clients with delayed shutdown via GLib timeout
- Fix LSP WS server ↔ Godot LSP communication flow
- Terminal (VteWidget):
- Switch to async spawn with full environment inheritance
- Add PROMPT_COMMAND OSC7 support for cwd tracking
- Improve UX: scrollback, no audible bell, auto scroll
- Implement clipboard shortcuts, selection copy, middle-click paste
- Track cwd changes and update UI label
- Add proper signal wiring and cleanup on destroy
- Code folding:
- Add fold support for JS, HTML, CSS, JSON, C, C++, Go
- Reset fold state safely when AST or filetype is unavailable
- UI (Plugins dialog):
- Improve dialog behavior (non-modal, centered, transient)
- Add focus-out auto-hide and Ctrl+Shift+P shortcut
- Misc:
- Add type hints in VTE widget
- Update TODOs (remove completed items, add LSP comm fix)
- Add terminal plugin scaffolding
2026-04-13 00:50:42 -05:00
|
|
|
from gi.repository import Gdk
|
|
|
|
|
from gi.repository import GLib
|
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)
2026-03-21 13:22:20 -05:00
|
|
|
|
|
|
|
|
# Application imports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PluginsUI(Gtk.Dialog):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
super(PluginsUI, self).__init__()
|
|
|
|
|
|
|
|
|
|
self._setup_styling()
|
|
|
|
|
self._setup_signals()
|
|
|
|
|
self._subscribe_to_events()
|
|
|
|
|
self._load_widgets()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _setup_styling(self):
|
|
|
|
|
header = Gtk.HeaderBar()
|
|
|
|
|
self.ctx = self.get_style_context()
|
|
|
|
|
self.ctx.add_class("plugin-ui")
|
|
|
|
|
|
|
|
|
|
self.set_title("Plugins")
|
|
|
|
|
self.set_size_request(450, 530)
|
feat: improve LSP lifecycle, terminal widget, and code folding support
- LSP:
- Add shutdown and exit request/notification handling
- Send initialized notification after initialize response
- Gracefully close clients with delayed shutdown via GLib timeout
- Fix LSP WS server ↔ Godot LSP communication flow
- Terminal (VteWidget):
- Switch to async spawn with full environment inheritance
- Add PROMPT_COMMAND OSC7 support for cwd tracking
- Improve UX: scrollback, no audible bell, auto scroll
- Implement clipboard shortcuts, selection copy, middle-click paste
- Track cwd changes and update UI label
- Add proper signal wiring and cleanup on destroy
- Code folding:
- Add fold support for JS, HTML, CSS, JSON, C, C++, Go
- Reset fold state safely when AST or filetype is unavailable
- UI (Plugins dialog):
- Improve dialog behavior (non-modal, centered, transient)
- Add focus-out auto-hide and Ctrl+Shift+P shortcut
- Misc:
- Add type hints in VTE widget
- Update TODOs (remove completed items, add LSP comm fix)
- Add terminal plugin scaffolding
2026-04-13 00:50:42 -05:00
|
|
|
self.set_modal(False)
|
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)
2026-03-21 13:22:20 -05:00
|
|
|
self.set_deletable(False)
|
|
|
|
|
self.set_skip_pager_hint(True)
|
|
|
|
|
self.set_skip_taskbar_hint(True)
|
|
|
|
|
|
|
|
|
|
header.set_title("Plugins")
|
|
|
|
|
self.set_titlebar(header)
|
|
|
|
|
header.show()
|
|
|
|
|
|
|
|
|
|
window = widget_registery.get_object("main-window")
|
|
|
|
|
self.set_transient_for(window)
|
feat: improve LSP lifecycle, terminal widget, and code folding support
- LSP:
- Add shutdown and exit request/notification handling
- Send initialized notification after initialize response
- Gracefully close clients with delayed shutdown via GLib timeout
- Fix LSP WS server ↔ Godot LSP communication flow
- Terminal (VteWidget):
- Switch to async spawn with full environment inheritance
- Add PROMPT_COMMAND OSC7 support for cwd tracking
- Improve UX: scrollback, no audible bell, auto scroll
- Implement clipboard shortcuts, selection copy, middle-click paste
- Track cwd changes and update UI label
- Add proper signal wiring and cleanup on destroy
- Code folding:
- Add fold support for JS, HTML, CSS, JSON, C, C++, Go
- Reset fold state safely when AST or filetype is unavailable
- UI (Plugins dialog):
- Improve dialog behavior (non-modal, centered, transient)
- Add focus-out auto-hide and Ctrl+Shift+P shortcut
- Misc:
- Add type hints in VTE widget
- Update TODOs (remove completed items, add LSP comm fix)
- Add terminal plugin scaffolding
2026-04-13 00:50:42 -05:00
|
|
|
self.set_destroy_with_parent(True)
|
|
|
|
|
|
|
|
|
|
self.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
|
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)
2026-03-21 13:22:20 -05:00
|
|
|
|
|
|
|
|
def _setup_signals(self):
|
feat: improve LSP lifecycle, terminal widget, and code folding support
- LSP:
- Add shutdown and exit request/notification handling
- Send initialized notification after initialize response
- Gracefully close clients with delayed shutdown via GLib timeout
- Fix LSP WS server ↔ Godot LSP communication flow
- Terminal (VteWidget):
- Switch to async spawn with full environment inheritance
- Add PROMPT_COMMAND OSC7 support for cwd tracking
- Improve UX: scrollback, no audible bell, auto scroll
- Implement clipboard shortcuts, selection copy, middle-click paste
- Track cwd changes and update UI label
- Add proper signal wiring and cleanup on destroy
- Code folding:
- Add fold support for JS, HTML, CSS, JSON, C, C++, Go
- Reset fold state safely when AST or filetype is unavailable
- UI (Plugins dialog):
- Improve dialog behavior (non-modal, centered, transient)
- Add focus-out auto-hide and Ctrl+Shift+P shortcut
- Misc:
- Add type hints in VTE widget
- Update TODOs (remove completed items, add LSP comm fix)
- Add terminal plugin scaffolding
2026-04-13 00:50:42 -05:00
|
|
|
self.connect("focus-out-event", self._on_focus_out)
|
|
|
|
|
self.connect("key-release-event", self._on_key_release)
|
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)
2026-03-21 13:22:20 -05:00
|
|
|
|
|
|
|
|
def _subscribe_to_events(self):
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
def _load_widgets(self):
|
|
|
|
|
widget_registery.expose_object("plugin-ui", self)
|
|
|
|
|
|
|
|
|
|
content_area = self.get_content_area()
|
|
|
|
|
scrolled_win = Gtk.ScrolledWindow()
|
|
|
|
|
viewport = Gtk.Viewport()
|
|
|
|
|
self.list_box = Gtk.ListBox()
|
|
|
|
|
|
|
|
|
|
self.list_box.set_selection_mode( Gtk.SelectionMode.NONE )
|
|
|
|
|
scrolled_win.set_vexpand(True)
|
|
|
|
|
|
|
|
|
|
viewport.add(self.list_box)
|
|
|
|
|
scrolled_win.add(viewport)
|
|
|
|
|
content_area.add(scrolled_win)
|
|
|
|
|
|
|
|
|
|
scrolled_win.show_all()
|
|
|
|
|
|
feat: improve LSP lifecycle, terminal widget, and code folding support
- LSP:
- Add shutdown and exit request/notification handling
- Send initialized notification after initialize response
- Gracefully close clients with delayed shutdown via GLib timeout
- Fix LSP WS server ↔ Godot LSP communication flow
- Terminal (VteWidget):
- Switch to async spawn with full environment inheritance
- Add PROMPT_COMMAND OSC7 support for cwd tracking
- Improve UX: scrollback, no audible bell, auto scroll
- Implement clipboard shortcuts, selection copy, middle-click paste
- Track cwd changes and update UI label
- Add proper signal wiring and cleanup on destroy
- Code folding:
- Add fold support for JS, HTML, CSS, JSON, C, C++, Go
- Reset fold state safely when AST or filetype is unavailable
- UI (Plugins dialog):
- Improve dialog behavior (non-modal, centered, transient)
- Add focus-out auto-hide and Ctrl+Shift+P shortcut
- Misc:
- Add type hints in VTE widget
- Update TODOs (remove completed items, add LSP comm fix)
- Add terminal plugin scaffolding
2026-04-13 00:50:42 -05:00
|
|
|
def _on_key_release(self, widget, event):
|
|
|
|
|
ctrl_pressed = event.state & Gdk.ModifierType.CONTROL_MASK
|
|
|
|
|
shift_pressed = event.state & Gdk.ModifierType.SHIFT_MASK
|
|
|
|
|
|
|
|
|
|
if ctrl_pressed:
|
|
|
|
|
if shift_pressed:
|
|
|
|
|
if event.keyval == Gdk.KEY_P:
|
|
|
|
|
self.hide()
|
|
|
|
|
|
|
|
|
|
def _on_focus_out(self, *args):
|
|
|
|
|
self.hide()
|
|
|
|
|
GLib.idle_add(self.hide)
|
|
|
|
|
|
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)
2026-03-21 13:22:20 -05:00
|
|
|
def add_row(self, manifest_meta, callback: callable):
|
|
|
|
|
box = Gtk.Box()
|
|
|
|
|
plugin_lbl = Gtk.Label(label = manifest_meta.manifest.name)
|
|
|
|
|
author_lbl = Gtk.Label(label = manifest_meta.manifest.author)
|
|
|
|
|
version_lbl = Gtk.Label(label = manifest_meta.manifest.version)
|
|
|
|
|
is_autoload = manifest_meta.manifest.autoload
|
|
|
|
|
toggle_bttn = Gtk.ToggleButton(label = "Unload" if is_autoload else "Load")
|
|
|
|
|
|
|
|
|
|
toggle_bttn.set_active(is_autoload)
|
|
|
|
|
plugin_lbl.set_hexpand(True)
|
|
|
|
|
box.set_hexpand(True)
|
|
|
|
|
version_lbl.set_margin_left(15)
|
|
|
|
|
version_lbl.set_margin_right(15)
|
|
|
|
|
toggle_bttn.set_size_request(120, -1)
|
|
|
|
|
|
|
|
|
|
toggle_bttn.toggle_id = \
|
|
|
|
|
toggle_bttn.connect("toggled", callback, manifest_meta)
|
2026-03-23 23:05:20 -05:00
|
|
|
box.toggle_bttn = toggle_bttn
|
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)
2026-03-21 13:22:20 -05:00
|
|
|
|
|
|
|
|
box.add(plugin_lbl)
|
|
|
|
|
box.add(author_lbl)
|
|
|
|
|
box.add(version_lbl)
|
|
|
|
|
box.add(toggle_bttn)
|
|
|
|
|
box.manifest_meta = manifest_meta
|
|
|
|
|
|
|
|
|
|
box.show_all()
|
|
|
|
|
self.list_box.add(box)
|
|
|
|
|
|
|
|
|
|
def remove_row(self, manifest_meta):
|
|
|
|
|
for row in self.list_box.get_children():
|
|
|
|
|
child = row.get_children()[0]
|
|
|
|
|
if not child.manifest_meta == manifest_meta: continue
|
|
|
|
|
|
|
|
|
|
child.manifest_meta = None
|
|
|
|
|
toggle_bttn = getattr(child, "toggle_bttn", None)
|
|
|
|
|
toggle_bttn.disconnect(toggle_bttn.toggle_id)
|
|
|
|
|
|
|
|
|
|
self.list_box.remove(row)
|
2026-03-23 23:05:20 -05:00
|
|
|
child.destroy()
|
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)
2026-03-21 13:22:20 -05:00
|
|
|
break
|