diff --git a/lib/pytest-lsp/pytest_lsp/client.py b/lib/pytest-lsp/pytest_lsp/client.py index 0df91e5..caeeca2 100644 --- a/lib/pytest-lsp/pytest_lsp/client.py +++ b/lib/pytest-lsp/pytest_lsp/client.py @@ -23,6 +23,7 @@ from .protocol import LanguageClientProtocol if typing.TYPE_CHECKING: + from collections.abc import Sequence from typing import Any @@ -53,7 +54,7 @@ def __init__(self, *args, configuration: dict[str, Any] | None = None, **kwargs) self.log_messages: list[types.LogMessageParams] = [] """Holds any received ``window/logMessage`` requests.""" - self.diagnostics: dict[str, list[types.Diagnostic]] = {} + self.diagnostics: dict[str, Sequence[types.Diagnostic]] = {} """Holds any recieved diagnostics.""" self.progress_reports: dict[ @@ -108,7 +109,7 @@ async def server_exit(self, server: asyncio.subprocess.Process): logger.debug("Cancelled pending request '%s': %s", id_, reason) def report_server_error( - self, error: Exception, source: PyglsError | JsonRpcException + self, error: Exception, source: type[PyglsError | JsonRpcException] ): """Called when the server does something unexpected, e.g. sending malformed JSON.""" diff --git a/lib/pytest-lsp/pytest_lsp/protocol.py b/lib/pytest-lsp/pytest_lsp/protocol.py index 23efe5f..8578747 100644 --- a/lib/pytest-lsp/pytest_lsp/protocol.py +++ b/lib/pytest-lsp/pytest_lsp/protocol.py @@ -54,7 +54,7 @@ def _handle_notification(self, method_name, params): super()._handle_notification(method_name, params) - async def send_request_async(self, method, params=None): + async def send_request_async(self, method, params=None, msg_id=None): """Wrap pygls' ``send_request_async`` implementation. This will - Check the params to see if they're compatible with the client's stated @@ -78,7 +78,7 @@ async def send_request_async(self, method, params=None): check_params_against_client_capabilities( self._server.capabilities, method, params ) - result = await super().send_request_async(method, params) + result = await super().send_request_async(method, params, msg_id) check_result_against_client_capabilities( self._server.capabilities, method,