feat: improve code completion, terminal setup, and plugin events
Add interactive LSP completion with debounced requests and cancellation Support C source files in Tree-sitter parsing and code folding Fix search-and-replace selection handling Improve split-pane expansion and terminal initialization Configure custom Bash startup files and script paths Update WebKit2 requirements to version 4.1 Unify application event registration and preserve controller message results Rename the UI plugin exception and clean up event emission APIs Refine 'code' plugin 'search' field limits and related widget behavior
This commit is contained in:
+2
-2
@@ -70,7 +70,7 @@ def custom_except_hook(exc_type, exc_value, exc_traceback):
|
||||
sys.__excepthook__(exc_type, exc_value, exc_traceback)
|
||||
sys.__excepthook__(exc_type, exc_value, exc_traceback)
|
||||
return
|
||||
#
|
||||
|
||||
logger.error("Uncaught exception", exc_info = (exc_type, exc_value, exc_traceback))
|
||||
#
|
||||
|
||||
sys.excepthook = custom_except_hook
|
||||
+1
-1
@@ -4,12 +4,12 @@
|
||||
import argparse
|
||||
import faulthandler
|
||||
import traceback
|
||||
from setproctitle import setproctitle
|
||||
|
||||
import tracemalloc
|
||||
tracemalloc.start()
|
||||
|
||||
# Lib imports
|
||||
from setproctitle import setproctitle
|
||||
|
||||
# Application imports
|
||||
from __builtins__ import *
|
||||
|
||||
@@ -17,4 +17,4 @@ def execute(
|
||||
**kwargs
|
||||
):
|
||||
logger.debug("Command: Set MiniView")
|
||||
event_system.emit("set-mini-view", (view,))
|
||||
event_system.emit("set-mini-view", (view, ))
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
import gi
|
||||
gi.require_version('GtkSource', '4')
|
||||
|
||||
from gi.repository import GLib
|
||||
from gi.repository import GtkSource
|
||||
|
||||
# Application imports
|
||||
|
||||
@@ -88,7 +88,7 @@ class VteWidget(Vte.Terminal):
|
||||
self.spawn_async(
|
||||
Vte.PtyFlags.DEFAULT,
|
||||
settings_manager.path_manager.get_home_path(),
|
||||
["/bin/bash"],
|
||||
["/bin/bash", "--rcfile", f"{settings_manager.path_manager.get_home_path()}/.bashrc", "-i"],
|
||||
env,
|
||||
GLib.SpawnFlags.DEFAULT,
|
||||
None, None, -1, None, None,
|
||||
|
||||
@@ -5,7 +5,7 @@ import json
|
||||
# Lib imports
|
||||
import gi
|
||||
gi.require_version('Gdk', '3.0')
|
||||
gi.require_version('WebKit2', '4.0')
|
||||
gi.require_version('WebKit2', '4.1')
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gio
|
||||
|
||||
@@ -37,8 +37,10 @@ class ControllerBase(Singleton, EmitDispatcher):
|
||||
return self.controller_message_bus.message_to(name, event)
|
||||
|
||||
def message_to_selected(self, names: list[str], event: BaseEvent):
|
||||
for name in names:
|
||||
return [
|
||||
self.controller_message_bus.message_to_selected(name, event)
|
||||
for name in names
|
||||
]
|
||||
|
||||
def register_controller(self, name: str, controller):
|
||||
self.controller_message_bus.register_controller(name, controller)
|
||||
|
||||
@@ -31,7 +31,7 @@ class EventFactory(Singleton):
|
||||
event_type = self._class_name_to_event_type(name)
|
||||
|
||||
self._event_classes[event_type] = obj
|
||||
Code_Event_Types.add_event_class(name, obj)
|
||||
App_Event_Types.add_event_class(name, obj)
|
||||
i += 1
|
||||
|
||||
logger.debug(f"Registered {i} event types:")
|
||||
@@ -44,7 +44,7 @@ class EventFactory(Singleton):
|
||||
event_type = self._class_name_to_event_type(name)
|
||||
|
||||
del self._event_classes[event_type]
|
||||
Code_Event_Types.remove_event_class(name)
|
||||
App_Event_Types.remove_event_class(name)
|
||||
i += 1
|
||||
|
||||
logger.debug(f"Unregistered {i} event types:")
|
||||
@@ -98,6 +98,7 @@ class EventNamespace:
|
||||
|
||||
|
||||
|
||||
Code_Event_Types = EventNamespace()
|
||||
App_Event_Types = EventNamespace()
|
||||
Code_Event_Types = App_Event_Types
|
||||
Event_Factory = EventFactory()
|
||||
|
||||
|
||||
@@ -18,19 +18,19 @@ class IPCSignalsMixin:
|
||||
def handle_file_from_ipc(self, fpath: str) -> None:
|
||||
logger.debug(f"File From IPC: {fpath}")
|
||||
GLib.idle_add(
|
||||
self.broadcast_message, "handle-file", (fpath,)
|
||||
self.broadcast_message, "handle-file", (fpath, )
|
||||
)
|
||||
|
||||
def handle_files_from_ipc(self, uris: list) -> None:
|
||||
logger.debug(f"Files From IPC: {uris}")
|
||||
GLib.idle_add(
|
||||
self.broadcast_message, "handle-files", (uris,)
|
||||
self.broadcast_message, "handle-files", (uris, )
|
||||
)
|
||||
|
||||
def handle_dir_from_ipc(self, fpath: str) -> None:
|
||||
logger.debug(f"Dir From IPC: {fpath}")
|
||||
GLib.idle_add(
|
||||
self.broadcast_message, "handle-folder", (fpath,)
|
||||
self.broadcast_message, "handle-folder", (fpath, )
|
||||
)
|
||||
|
||||
def broadcast_message(self, message_type: str = "none", data: () = ()) -> None:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Lib imports
|
||||
import gi
|
||||
gi.require_version('WebKit2', '4.0')
|
||||
gi.require_version('WebKit2', '4.1')
|
||||
from gi.repository import WebKit2
|
||||
|
||||
# Application imports
|
||||
|
||||
@@ -41,10 +41,10 @@ class PluginCode(PluginBase):
|
||||
return self.plugin_context.request_ui_element(element_id)
|
||||
|
||||
def emit(self, event: BaseEvent):
|
||||
return self.plugin_context.emit(event)
|
||||
self.plugin_context.emit(event)
|
||||
|
||||
def emit_to(self, name: str, event: BaseEvent):
|
||||
return self.plugin_context.emit_to(name, event)
|
||||
self.plugin_context.emit_to(name, event)
|
||||
|
||||
def emit_to_selected(self, names: list[str], event: BaseEvent):
|
||||
return self.plugin_context.emit_to_selected(names, event)
|
||||
self.plugin_context.emit_to_selected(names, event)
|
||||
|
||||
@@ -10,7 +10,7 @@ from .plugin_base import PluginBase
|
||||
|
||||
|
||||
|
||||
class PluginCodeException(Exception):
|
||||
class PluginUIException(Exception):
|
||||
...
|
||||
|
||||
|
||||
@@ -23,22 +23,22 @@ class PluginUI(PluginBase):
|
||||
|
||||
|
||||
def _controller_message(self, event: BaseEvent):
|
||||
raise PluginCodeException("Plugin UI '_controller_message' must be overriden by Plugin")
|
||||
raise PluginUIException("Plugin UI '_controller_message' must be overriden by Plugin")
|
||||
|
||||
def load(self):
|
||||
raise PluginCodeException("Plugin UI 'load' must be overriden by Plugin")
|
||||
raise PluginUIException("Plugin UI 'load' must be overriden by Plugin")
|
||||
|
||||
def run(self):
|
||||
raise PluginCodeException("Plugin UI 'run' must be overriden by Plugin")
|
||||
raise PluginUIException("Plugin UI 'run' must be overriden by Plugin")
|
||||
|
||||
def request_ui_element(self, element_id: str):
|
||||
return self.plugin_context.request_ui_element(element_id)
|
||||
|
||||
def emit(self, event: BaseEvent):
|
||||
return self.plugin_context.emit(event)
|
||||
self.plugin_context.emit(event)
|
||||
|
||||
def emit_to(self, name: str, event: BaseEvent):
|
||||
return self.plugin_context.emit_to(name, event)
|
||||
self.plugin_context.emit_to(name, event)
|
||||
|
||||
def emit_to_selected(self, names: list[str], event: BaseEvent):
|
||||
return self.plugin_context.emit_to_selected(names, event)
|
||||
self.plugin_context.emit_to_selected(names, event)
|
||||
|
||||
Reference in New Issue
Block a user