|
2 | 2 | import os |
3 | 3 | import sys |
4 | 4 | import threading |
5 | | -import jsonrpc.dispatchers |
6 | | -import jsonrpc.endpoint |
7 | | -import jsonrpc.streams |
| 5 | +import pyls_jsonrpc.dispatchers |
| 6 | +import pyls_jsonrpc.endpoint |
| 7 | +import pyls_jsonrpc.streams |
8 | 8 | from dataclasses import dataclass |
9 | 9 | from functools import wraps |
10 | 10 | from pathlib import Path, PurePath |
@@ -179,17 +179,17 @@ def create_lsp_diagnostics(self) -> object: |
179 | 179 | } for diagnostic in self.diagnostics] |
180 | 180 |
|
181 | 181 |
|
182 | | -class LanguageServer(jsonrpc.dispatchers.MethodDispatcher): |
| 182 | +class LanguageServer(pyls_jsonrpc.dispatchers.MethodDispatcher): |
183 | 183 | def __init__(self, rx: BinaryIO, tx: BinaryIO) -> None: |
184 | 184 | self.project: Optional[Project] = None |
185 | 185 | self.root_uri = '' |
186 | 186 | self.workspace: Dict[str, WorkspaceEntry] = {} |
187 | 187 | self.path_to_uri: Dict[PurePath, Uri] = {} |
188 | 188 | self.diagnostics: Dict[PurePath, List[types.Diagnostic]] = {} |
189 | 189 |
|
190 | | - self._jsonrpc_stream_reader = jsonrpc.streams.JsonRpcStreamReader(rx) |
191 | | - self._jsonrpc_stream_writer = jsonrpc.streams.JsonRpcStreamWriter(tx) |
192 | | - self._endpoint = jsonrpc.endpoint.Endpoint(self, self._jsonrpc_stream_writer.write) |
| 190 | + self._jsonrpc_stream_reader = pyls_jsonrpc.streams.JsonRpcStreamReader(rx) |
| 191 | + self._jsonrpc_stream_writer = pyls_jsonrpc.streams.JsonRpcStreamWriter(tx) |
| 192 | + self._endpoint = pyls_jsonrpc.endpoint.Endpoint(self, self._jsonrpc_stream_writer.write) |
193 | 193 | self._shutdown = False |
194 | 194 |
|
195 | 195 | def start(self) -> None: |
@@ -293,4 +293,5 @@ def m_exit(self, **_kwargs: object) -> None: |
293 | 293 | def start() -> None: |
294 | 294 | stdin, stdout = sys.stdin.buffer, sys.stdout.buffer |
295 | 295 | server = LanguageServer(stdin, stdout) |
| 296 | + logger.info('Started') |
296 | 297 | server.start() |
0 commit comments