Skip to content

Commit

Permalink
pytest-lsp: mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Nov 23, 2024
1 parent acfff66 commit e2a1f12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/pytest-lsp/pytest_lsp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .protocol import LanguageClientProtocol

if typing.TYPE_CHECKING:
from collections.abc import Sequence
from typing import Any


Expand Down Expand Up @@ -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[
Expand Down Expand Up @@ -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."""
Expand Down
4 changes: 2 additions & 2 deletions lib/pytest-lsp/pytest_lsp/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit e2a1f12

Please sign in to comment.