- Replace legacy LSPManagerClient + LSPManagerUI with ClientManager and UIManager - Remove WebsocketClient in favor of unified Websocket implementation - Move LSP initialization config loading into centralized config module - Update LSPClient to support dynamic socket, improved init params, and doc version tracking - Introduce range-based didChange notifications and add implementation + references requests - Expand LSPClientEvents to support implementation/references and structured range edits - Simplify websocket response handling and normalize LSP response parsing flow - Decouple UI from LSP manager core; UI now emits address/port for client creation - Refactor completion provider pipeline: - Split TextChangedEvent into TextInsertedEvent and DeleteRangeEvent - Update ProviderResponseCacheBase and controller dispatch paths accordingly - Improve SourceBuffer and SourceFile event tracking with delete-range support - Update plugin system: - Centralize command/provider registration via helper methods - Add LSP commands: definition, references, implementation, toggle UI - Enhance response handlers to support references and implementation hooks - Improve Python LSP config (jedi completion, signatures, references enabled) - Fix minor GTK lifecycle and buffer signal handling issues - Clean up unused imports, dead code, and outdated JSON server configs
39 lines
811 B
Python
39 lines
811 B
Python
# Python imports
|
|
from os import path
|
|
import json
|
|
|
|
# Lib imports
|
|
|
|
# Application imports
|
|
|
|
|
|
|
|
LSP_HOST: str = "127.0.0.1"
|
|
LSP_PORT: int = 9999
|
|
LSP_CONNECT_TIMOUT: float = 5.0
|
|
|
|
|
|
|
|
def get_lsp_host_addr() -> str:
|
|
return LSP_HOST
|
|
|
|
def get_lsp_host_port() -> int:
|
|
return LSP_PORT
|
|
|
|
def get_lsp_connect_timout() -> float:
|
|
return LSP_CONNECT_TIMOUT
|
|
|
|
def get_lsp_init_config() -> dict:
|
|
try:
|
|
_USER_HOME = path.expanduser('~')
|
|
_SCRIPT_PTH = path.dirname( path.realpath(__file__) )
|
|
_LSP_INIT_CONFIG = f"{_SCRIPT_PTH}/configs/initialize-params-slim.json"
|
|
|
|
with open(_LSP_INIT_CONFIG) as file:
|
|
data = file.read()
|
|
return json.loads(data)
|
|
except Exception as e:
|
|
logger.error( f"LSP Controller: {_LSP_INIT_CONFIG}\n\t\t{repr(e)}" )
|
|
|
|
return {}
|