generated from itdominator/Python-With-Gtk-Template
Re-ordered commands and updated lsp settings
This commit is contained in:
parent
cc0117da78
commit
de8fe47231
|
@ -1,4 +1,5 @@
|
|||
# Python imports
|
||||
import traceback
|
||||
import subprocess
|
||||
|
||||
# Lib imports
|
||||
|
@ -42,7 +43,7 @@ class LSPControllerSTDInSTDOut(LSPControllerBase):
|
|||
"2.0",
|
||||
None,
|
||||
{
|
||||
"error": repr(e)
|
||||
"error": traceback.format_exc()
|
||||
}
|
||||
)
|
||||
)
|
||||
|
@ -114,4 +115,3 @@ class LSPControllerSTDInSTDOut(LSPControllerBase):
|
|||
|
||||
if not lsp_response: return
|
||||
GLib.idle_add(self.handle_lsp_response, lsp_response)
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# Python imports
|
||||
import traceback
|
||||
import subprocess
|
||||
|
||||
# Lib imports
|
||||
|
@ -29,7 +30,7 @@ class LSPControllerWebsocket(LSPControllerBase):
|
|||
if not self._start_command: return
|
||||
try:
|
||||
self.lsp_process = subprocess.Popen(
|
||||
["pylsp", "--ws", "--port", "4114"],
|
||||
self._start_command,
|
||||
stdout = subprocess.PIPE,
|
||||
stdin = subprocess.PIPE
|
||||
)
|
||||
|
@ -40,7 +41,7 @@ class LSPControllerWebsocket(LSPControllerBase):
|
|||
"2.0",
|
||||
None,
|
||||
{
|
||||
"error": repr(e)
|
||||
"error": traceback.format_exc()
|
||||
}
|
||||
)
|
||||
)
|
||||
|
|
|
@ -87,8 +87,8 @@ class LSPMessageBox(Gtk.Box):
|
|||
|
||||
def start_stop_lsp(self):
|
||||
parent = self.get_parent()
|
||||
_command: str = parent.alt_command_entry.get_text()
|
||||
# _command: str = parent.command_entry.get_text()
|
||||
_command: str = parent.command_entry.get_text()
|
||||
# _command: str = parent.alt_command_entry.get_text()
|
||||
# _command: str = parent.socket_entry.get_text()
|
||||
command: [] = _command.split() if len( _command.split() ) > 0 else [ _command ]
|
||||
|
||||
|
|
|
@ -81,12 +81,12 @@ class LSPUI(Gtk.Grid):
|
|||
# child, left, top, width, height
|
||||
self.attach(self.link_btn, 0, 0, 3, 1)
|
||||
|
||||
self.attach(alt_command_lbl, 0, 1, 1, 1)
|
||||
self.attach(command_lbl, 0, 2, 1, 1)
|
||||
self.attach(command_lbl, 0, 1, 1, 1)
|
||||
self.attach(alt_command_lbl, 0, 2, 1, 1)
|
||||
self.attach(socket_lbl, 0, 3, 1, 1)
|
||||
|
||||
self.attach(self.alt_command_entry, 1, 1, 2, 1)
|
||||
self.attach(self.command_entry, 1, 2, 2, 1)
|
||||
self.attach(self.command_entry, 1, 1, 2, 1)
|
||||
self.attach(self.alt_command_entry, 1, 2, 2, 1)
|
||||
self.attach(self.socket_entry, 1, 3, 2, 1)
|
||||
|
||||
self.attach(init_options_lbl, 0, 4, 3, 1)
|
||||
|
|
|
@ -69,7 +69,6 @@ class LSPEndpointServer(Singleton):
|
|||
start_time = time.perf_counter()
|
||||
self._handle_ipc_message(conn, start_time)
|
||||
except Exception as e:
|
||||
# logger.debug( repr(e) )
|
||||
logger.debug( traceback.print_exc() )
|
||||
|
||||
listener.close()
|
||||
|
@ -120,7 +119,7 @@ class LSPEndpointServer(Singleton):
|
|||
except ConnectionRefusedError as e:
|
||||
logger.error("Connection refused...")
|
||||
except Exception as e:
|
||||
logger.error( repr(e) )
|
||||
logger.debug( traceback.print_exc() )
|
||||
|
||||
|
||||
def send_ipc_message(self, message: str = "Empty Data...") -> None:
|
||||
|
@ -137,7 +136,7 @@ class LSPEndpointServer(Singleton):
|
|||
except ConnectionRefusedError as e:
|
||||
logger.error("Connection refused...")
|
||||
except Exception as e:
|
||||
logger.error( repr(e) )
|
||||
logger.debug( traceback.print_exc() )
|
||||
|
||||
def send_test_ipc_message(self, message: str = "Empty Data...") -> None:
|
||||
try:
|
||||
|
@ -155,4 +154,4 @@ class LSPEndpointServer(Singleton):
|
|||
logger.error("LSP Socket no longer valid.... Removing.")
|
||||
os.unlink(self._ipc_address)
|
||||
except Exception as e:
|
||||
logger.error( repr(e) )
|
||||
logger.debug( traceback.print_exc() )
|
||||
|
|
|
@ -1,45 +1,17 @@
|
|||
{
|
||||
"sh": {
|
||||
"info": "",
|
||||
"alt-command": "",
|
||||
"command": "",
|
||||
"alt-command": "",
|
||||
"socket": "ws://127.0.0.1:3030/?name=shell",
|
||||
"initialization-options": {}
|
||||
},
|
||||
"python - pylsp": {
|
||||
"hidden": true,
|
||||
"info": "https://github.com/python-lsp/python-lsp-server",
|
||||
"alt-command": "pylsp --ws --port 3030",
|
||||
"command": "lsp-ws-proxy --listen 3030 -- pylsp",
|
||||
"socket": "ws://127.0.0.1:3030/?name=pylsp",
|
||||
"initialization-options": {
|
||||
"pylsp": {
|
||||
"plugins": {
|
||||
"rope_autoimport": {
|
||||
"enabled": true
|
||||
},
|
||||
"rope_completion": {
|
||||
"enabled": false,
|
||||
"eager": false
|
||||
},
|
||||
"jedi_completion": {
|
||||
"fuzzy": true
|
||||
},
|
||||
"jedi":{
|
||||
"extra_paths": [
|
||||
"/home/abaddon/Portable_Apps/py-venvs/pylsp-venv/venv/lib/python3.10/site-packages"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"python3 - pylsp": {
|
||||
"python": {
|
||||
"info": "https://github.com/python-lsp/python-lsp-server",
|
||||
"command": "pylsp --ws --port 4114",
|
||||
"alt-command": "pylsp",
|
||||
"alt-command2": "pylsp --ws --port 3030",
|
||||
"command": "lsp-ws-proxy --listen 3030 -- pylsp",
|
||||
"socket": "ws://127.0.0.1:3030/?name=pylsp",
|
||||
"alt-command2": "lsp-ws-proxy --listen 4114 -- pylsp",
|
||||
"socket": "ws://127.0.0.1:4114/?name=pylsp",
|
||||
"initialization-options": {
|
||||
"pylsp": {
|
||||
"plugins": {
|
||||
|
@ -75,11 +47,40 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"python3 - jedi-language-server": {
|
||||
"python - pylsp": {
|
||||
"hidden": true,
|
||||
"info": "https://github.com/python-lsp/python-lsp-server",
|
||||
"command": "lsp-ws-proxy --listen 3030 -- pylsp",
|
||||
"alt-command": "pylsp",
|
||||
"alt-command2": "pylsp --ws --port 3030",
|
||||
"socket": "ws://127.0.0.1:3030/?name=pylsp",
|
||||
"initialization-options": {
|
||||
"pylsp": {
|
||||
"plugins": {
|
||||
"rope_autoimport": {
|
||||
"enabled": true
|
||||
},
|
||||
"rope_completion": {
|
||||
"enabled": false,
|
||||
"eager": false
|
||||
},
|
||||
"jedi_completion": {
|
||||
"fuzzy": true
|
||||
},
|
||||
"jedi":{
|
||||
"extra_paths": [
|
||||
"/home/abaddon/Portable_Apps/py-venvs/pylsp-venv/venv/lib/python3.10/site-packages"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"python - jedi-language-server": {
|
||||
"hidden": true,
|
||||
"info": "https://pypi.org/project/jedi-language-server/",
|
||||
"alt-command": "jedi-language-server",
|
||||
"command": "lsp-ws-proxy --listen 3030 -- jedi-language-server",
|
||||
"alt-command": "jedi-language-server",
|
||||
"socket": "ws://127.0.0.1:3030/?name=jedi-language-server",
|
||||
"initialization-options": {
|
||||
"jediSettings": {
|
||||
|
@ -107,36 +108,36 @@
|
|||
},
|
||||
"c": {
|
||||
"info": "https://clangd.llvm.org/",
|
||||
"alt-command": "clangd",
|
||||
"command": "lsp-ws-proxy --listen 3030 -- clangd",
|
||||
"alt-command": "clangd",
|
||||
"socket": "ws://127.0.0.1:3030/?name=clangd",
|
||||
"initialization-options": {}
|
||||
},
|
||||
"cpp": {
|
||||
"info": "https://clangd.llvm.org/",
|
||||
"alt-command": "clangd",
|
||||
"command": "lsp-ws-proxy --listen 3030 -- clangd",
|
||||
"alt-command": "clangd",
|
||||
"socket": "ws://127.0.0.1:3030/?name=clangd",
|
||||
"initialization-options": {}
|
||||
},
|
||||
"java": {
|
||||
"info": "https://download.eclipse.org/jdtls/",
|
||||
"alt-command": "java-language-server",
|
||||
"command": "lsp-ws-proxy --listen 3030 -- java-language-server",
|
||||
"alt-command": "java-language-server",
|
||||
"socket": "ws://127.0.0.1:3030/?name=java-language-server",
|
||||
"initialization-options": {}
|
||||
},
|
||||
"lua": {
|
||||
"info": "https://github.com/LuaLS/lua-language-server",
|
||||
"alt-command": "lua-language-server",
|
||||
"command": "lsp-ws-proxy --listen 3030 -- lua-language-server",
|
||||
"alt-command": "lua-language-server",
|
||||
"socket": "ws://127.0.0.1:3030/?name=gopls",
|
||||
"initialization-options": {}
|
||||
},
|
||||
"go": {
|
||||
"info": "https://pkg.go.dev/golang.org/x/tools/gopls#section-readme",
|
||||
"alt-command": "gopls",
|
||||
"command": "lsp-ws-proxy --listen 3030 -- gopls",
|
||||
"alt-command": "gopls",
|
||||
"socket": "ws://127.0.0.1:3030/?name=gopls",
|
||||
"initialization-options": {}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue