More wiring of lsp manager calls and responses 2
This commit is contained in:
@@ -5,7 +5,7 @@ import os
|
||||
from gi.repository import GLib
|
||||
|
||||
# Application imports
|
||||
from libs.dto.lsp_messages import get_message_obj, didopen_notification, completion_request, didchange_notification
|
||||
from libs.dto.lsp_messages import get_message_obj, didopen_notification, didsave_notification, didclose_notification, completion_request, didchange_notification
|
||||
|
||||
|
||||
|
||||
@@ -40,12 +40,21 @@ class LSPControllerEvents:
|
||||
GLib.idle_add( self.send_notification, method, params )
|
||||
|
||||
def _lsp_did_save(self, data: dict):
|
||||
# GLib.idle_add( self.send_notification, method, params )
|
||||
...
|
||||
method = data["method"]
|
||||
params = didsave_notification["params"]
|
||||
|
||||
params["textDocument"]["uri"] = data["uri"]
|
||||
params["text"] = data["text"]
|
||||
|
||||
GLib.idle_add( self.send_notification, method, params )
|
||||
|
||||
def _lsp_did_close(self, data: dict):
|
||||
# GLib.idle_add( self.send_notification, method, params )
|
||||
...
|
||||
method = data["method"]
|
||||
params = didclose_notification["params"]
|
||||
|
||||
params["textDocument"]["uri"] = data["uri"]
|
||||
|
||||
GLib.idle_add( self.send_notification, method, params )
|
||||
|
||||
def _lsp_did_change(self, data: dict):
|
||||
method = data["method"]
|
||||
@@ -55,13 +64,14 @@ class LSPControllerEvents:
|
||||
params["textDocument"]["languageId"] = data["language_id"]
|
||||
params["textDocument"]["version"] = data["version"]
|
||||
|
||||
contentChanges = params["contentChanges"][0]
|
||||
start = contentChanges["range"]["start"]
|
||||
end = contentChanges["range"]["end"]
|
||||
start["line"] = data["line"]
|
||||
start["character"] = 0
|
||||
end["line"] = data["line"]
|
||||
end["character"] = data["column"]
|
||||
contentChanges = params["contentChanges"][0]
|
||||
start = contentChanges["range"]["start"]
|
||||
end = contentChanges["range"]["end"]
|
||||
contentChanges["text"] = data["text"]
|
||||
start["line"] = data["line"]
|
||||
start["character"] = 0
|
||||
end["line"] = data["line"]
|
||||
end["character"] = data["column"]
|
||||
|
||||
GLib.idle_add( self.send_notification, method, params )
|
||||
|
||||
@@ -85,4 +95,4 @@ class LSPControllerEvents:
|
||||
params["position"]["character"] = data["column"]
|
||||
|
||||
|
||||
GLib.idle_add( self.send_request, method, params )
|
||||
GLib.idle_add( self.send_request, method, params )
|
||||
|
Reference in New Issue
Block a user