generated from itdominator/Python-With-Gtk-Template
Added rclick copy to clip-board; extended LSP config
This commit is contained in:
parent
96abe163a5
commit
d00818a5b2
|
@ -52,6 +52,7 @@ class BaseController(IPCSignalsMixin, KeyboardSignalsMixin, BaseControllerData):
|
|||
event_system.subscribe("handle-file-from-ipc", self.handle_file_from_ipc)
|
||||
event_system.subscribe("handle-dir-from-ipc", self.handle_dir_from_ipc)
|
||||
event_system.subscribe("tggl-top-main-menubar", self._tggl_top_main_menubar)
|
||||
event_system.subscribe("copy-to-clipboard", self.set_clipboard_data)
|
||||
|
||||
def _load_controllers(self):
|
||||
BridgeController()
|
||||
|
@ -66,4 +67,4 @@ class BaseController(IPCSignalsMixin, KeyboardSignalsMixin, BaseControllerData):
|
|||
settings_manager.set_builder(self.builder)
|
||||
self.base_container = BaseContainer()
|
||||
|
||||
settings_manager.register_signals_to_builder([self, self.base_container])
|
||||
settings_manager.register_signals_to_builder([self, self.base_container])
|
|
@ -9,7 +9,7 @@ from gi.repository import GLib
|
|||
from libs.dto.lsp_messages import LEN_HEADER, TYPE_HEADER, get_message_str, get_message_obj
|
||||
from .lsp_controller_base import LSPControllerBase
|
||||
from libs.dto.lsp_message_structs import \
|
||||
LSPResponseTypes, ClientRequest, ClientNotification, LSPResponseRequest, LSPResponseNotification
|
||||
LSPResponseTypes, ClientRequest, ClientNotification, LSPResponseRequest, LSPResponseNotification, LSPResponseNotification
|
||||
|
||||
|
||||
|
||||
|
@ -109,9 +109,9 @@ class LSPControllerSTDInSTDOut(LSPControllerBase):
|
|||
lsp_response = LSPResponseRequest(**get_message_obj(data))
|
||||
|
||||
if "method" in keys:
|
||||
lsp_response = LSPResponseNotification(**get_message_obj(data))
|
||||
lsp_response = LSPResponseNotification(**get_message_obj(data)) if not "id" in keys else LSPIDResponseNotification( **get_message_obj(data) )
|
||||
|
||||
response_id = -1
|
||||
|
||||
if not lsp_response: return
|
||||
GLib.idle_add(self.handle_lsp_response, lsp_response)
|
||||
GLib.idle_add(self.handle_lsp_response, lsp_response)
|
|
@ -10,7 +10,7 @@ from gi.repository import GLib
|
|||
from libs.websocket_client import WebsocketClient
|
||||
from libs.dto.lsp_messages import LEN_HEADER, TYPE_HEADER, get_message_str, get_message_obj
|
||||
from libs.dto.lsp_message_structs import \
|
||||
LSPResponseTypes, ClientRequest, ClientNotification, LSPResponseRequest, LSPResponseNotification
|
||||
LSPResponseTypes, ClientRequest, ClientNotification, LSPResponseRequest, LSPResponseNotification, LSPIDResponseNotification
|
||||
from .lsp_controller_base import LSPControllerBase
|
||||
|
||||
|
||||
|
@ -77,7 +77,7 @@ class LSPControllerWebsocket(LSPControllerBase):
|
|||
lsp_response = LSPResponseRequest(**get_message_obj(data))
|
||||
|
||||
if "method" in keys:
|
||||
lsp_response = LSPResponseNotification(**get_message_obj(data))
|
||||
lsp_response = LSPResponseNotification(**get_message_obj(data)) if not "id" in keys else LSPIDResponseNotification( **get_message_obj(data) )
|
||||
|
||||
response_id = -1
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ class LogList(Gtk.ListBox):
|
|||
def tggl_row_view(lb, row):
|
||||
frame = row.get_child()
|
||||
revealer = frame.get_children()[0]
|
||||
self._active_label = revealer.get_children()[0]
|
||||
revealer.set_reveal_child( not revealer.get_reveal_child() )
|
||||
|
||||
del frame
|
||||
|
@ -47,6 +48,7 @@ class LogList(Gtk.ListBox):
|
|||
|
||||
self.connect("row-activated", tggl_row_view)
|
||||
self.connect("size-allocate", scroll_down)
|
||||
self.connect("button-release-event", self._label_button_release_event)
|
||||
|
||||
def _subscribe_to_events(self):
|
||||
...
|
||||
|
@ -87,4 +89,9 @@ class LogList(Gtk.ListBox):
|
|||
|
||||
def scroll_down(self):
|
||||
vadjustment = self.get_parent().get_vadjustment()
|
||||
vadjustment.set_value( vadjustment.get_upper())
|
||||
vadjustment.set_value( vadjustment.get_upper())
|
||||
|
||||
def _label_button_release_event(self, log_list, eve):
|
||||
if eve.button == 3:
|
||||
event_system.emit("copy-to-clipboard", self._active_label.get_label())
|
||||
return True
|
||||
|
|
|
@ -71,12 +71,25 @@ class LSPResponseNotification(object):
|
|||
method: str
|
||||
params: dict
|
||||
|
||||
@dataclass
|
||||
class LSPIDResponseNotification(object):
|
||||
"""
|
||||
Constructs a new LSP Response Notification instance.
|
||||
|
||||
class MessageTypes(ClientRequest, ClientNotification, LSPResponseRequest, LSPResponseNotification):
|
||||
:param str method: The type of lsp notification being made.
|
||||
:params dict result: The arguments of the given method.
|
||||
"""
|
||||
jsonrpc: str
|
||||
id: int
|
||||
method: str
|
||||
params: dict
|
||||
|
||||
|
||||
class MessageTypes(ClientRequest, ClientNotification, LSPResponseRequest, LSPResponseNotification, LSPIDResponseNotification):
|
||||
...
|
||||
|
||||
class ClientMessageTypes(ClientRequest, ClientNotification):
|
||||
...
|
||||
|
||||
class LSPResponseTypes(LSPResponseRequest, LSPResponseNotification):
|
||||
...
|
||||
...
|
|
@ -2,6 +2,7 @@
|
|||
"java": {
|
||||
"info": "https://download.eclipse.org/jdtls/",
|
||||
"info-init-options": "https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line",
|
||||
"info-import-build": "https://www.javahotchocolate.com/tutorials/build-path.html",
|
||||
"link": "https://download.eclipse.org/jdtls/milestones/?d",
|
||||
"command": "lsp-ws-proxy --listen 4114 -- jdtls",
|
||||
"alt-command": "lsp-ws-proxy -- jdtls",
|
||||
|
@ -13,8 +14,7 @@
|
|||
"intellicode-core.jar"
|
||||
],
|
||||
"workspaceFolders": [
|
||||
"<uri>",
|
||||
"<uri>"
|
||||
"file://"
|
||||
],
|
||||
"settings": {
|
||||
"java": {
|
||||
|
@ -36,18 +36,29 @@
|
|||
"globalSettings": "{user.home}/.config/jdtls/settings.xml"
|
||||
},
|
||||
"runtimes": [
|
||||
{
|
||||
"name": "JavaSE-17",
|
||||
"path": "/usr/lib/jvm/default-runtime",
|
||||
"javadoc": "https://docs.oracle.com/en/java/javase/17/docs/api/",
|
||||
"default": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"classPath": [
|
||||
"{user.home}/.config/jdtls/m2/repository/**/*.jar"
|
||||
"{user.home}/.config/jdtls/m2/repository/**/*-sources.jar",
|
||||
"lib/**/*-sources.jar"
|
||||
],
|
||||
"docPath": [
|
||||
"{user.home}/.config/jdtls/m2/repository/**/*.jar"
|
||||
"{user.home}/.config/jdtls/m2/repository/**/*-javadoc.jar",
|
||||
"lib/**/*-javadoc.jar"
|
||||
],
|
||||
"silentNotification": true,
|
||||
"project": {
|
||||
"encoding": "ignore",
|
||||
"outputPath": "bin",
|
||||
"referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
"lib/**/*.jar",
|
||||
"{user.home}/.config/jdtls/m2/repository/**/*.jar"
|
||||
],
|
||||
"importOnFirstTimeStartup": "automatic",
|
||||
"importHint": true,
|
||||
|
@ -55,10 +66,10 @@
|
|||
"node_modules",
|
||||
"\\.git"
|
||||
],
|
||||
"encoding": "ignore",
|
||||
"exportJar": {
|
||||
"targetPath": "${workspaceFolder}/${workspaceFolderBasename}.jar"
|
||||
}
|
||||
"sourcePaths": [
|
||||
"src",
|
||||
"{user.home}/.config/jdtls/m2/repository/**/*.jar"
|
||||
]
|
||||
},
|
||||
"sources": {
|
||||
"organizeImports": {
|
||||
|
|
Loading…
Reference in New Issue