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
This commit is contained in:
2026-04-13 00:50:42 -05:00
parent d8e0185d1c
commit 12b5fe7304
15 changed files with 585 additions and 34 deletions

View File

@@ -2,7 +2,10 @@
# Lib imports
import gi
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GLib
# Application imports
@@ -25,6 +28,7 @@ class PluginsUI(Gtk.Dialog):
self.set_title("Plugins")
self.set_size_request(450, 530)
self.set_modal(False)
self.set_deletable(False)
self.set_skip_pager_hint(True)
self.set_skip_taskbar_hint(True)
@@ -35,9 +39,13 @@ class PluginsUI(Gtk.Dialog):
window = widget_registery.get_object("main-window")
self.set_transient_for(window)
self.set_destroy_with_parent(True)
self.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
def _setup_signals(self):
...
self.connect("focus-out-event", self._on_focus_out)
self.connect("key-release-event", self._on_key_release)
def _subscribe_to_events(self):
...
@@ -59,6 +67,19 @@ class PluginsUI(Gtk.Dialog):
scrolled_win.show_all()
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)
def add_row(self, manifest_meta, callback: callable):
box = Gtk.Box()
plugin_lbl = Gtk.Label(label = manifest_meta.manifest.name)