refactor(lsp): replace LSPManager with controller-based architecture
- Remove legacy LSPManager dialog implementation - Introduce LSPController as the central LSP entry point - Route UI interactions through lsp_controller.lsp_manager_ui - Move client lifecycle handling out of ProviderResponseCache - Simplify completion cache and matcher filtering - Improve LSP completion item parsing with safer fallbacks - Modernize typing (Python 3.10 union syntax) - Remove unused imports and dead code - Use GLib.idle_add for safe UI scrolling operations - Minor comment and spelling fixes
This commit is contained in:
@@ -22,7 +22,7 @@ class Provider(GObject.GObject, GtkSource.CompletionProvider):
|
||||
def __init__(self):
|
||||
super(Provider, self).__init__()
|
||||
|
||||
self.response_cache: ProviderResponseCache = ProviderResponseCache()
|
||||
self.response_cache: ProviderResponseCache = None
|
||||
|
||||
|
||||
def pre_populate(self, context):
|
||||
@@ -32,13 +32,19 @@ class Provider(GObject.GObject, GtkSource.CompletionProvider):
|
||||
return "LSP Code Completion"
|
||||
|
||||
def do_match(self, context):
|
||||
# Note: If provider is in interactive activation then need to check
|
||||
# view focus as otherwise non focus views start trying to grab it.
|
||||
# completion = context.get_property("completion")
|
||||
# if not completion.get_view().has_focus(): return
|
||||
|
||||
iter = self.response_cache.get_iter_correctly(context)
|
||||
iter.backward_char()
|
||||
ch = iter.get_char()
|
||||
|
||||
# NOTE: Look to re-add or apply supprting logic to use spaces
|
||||
# NOTE: Look to re-add or apply supporting logic to use spaces
|
||||
# As is it slows down the editor in certain contexts...
|
||||
if not (ch in ('_', '.', ' ') or ch.isalnum()):
|
||||
# if not (ch in ('_', '.', ' ') or ch.isalnum()):
|
||||
if not (ch in ('_', '.') or ch.isalnum()):
|
||||
return False
|
||||
|
||||
buffer = iter.get_buffer()
|
||||
|
||||
Reference in New Issue
Block a user