Skip to content

Commit c2828f7

Browse files
committed
style: format utils/inspect
1 parent 5572560 commit c2828f7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/lsp_client/utils/inspect.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import itertools
4+
from collections.abc import AsyncGenerator
45

56
from attrs import frozen
67

@@ -18,17 +19,20 @@
1819

1920

2021
@frozen
21-
class CheckResult:
22+
class CapabilityInspectResult:
2223
capability: str
2324
client: bool
2425
server: bool
2526

2627

27-
async def inspect_capabilities(server: LSPServer, client_cls: type[LSPClient]):
28+
async def inspect_capabilities(
29+
server: LSPServer, client_cls: type[LSPClient]
30+
) -> AsyncGenerator[CapabilityInspectResult]:
2831
if not __debug__:
2932
raise RuntimeError("inspect_capabilities can only be used in debug mode")
3033

3134
async with server.serve():
35+
# send a fake initialize request to get server capabilities
3236
req = lsp_type.InitializeRequest(
3337
id="initialize",
3438
params=lsp_type.InitializeParams(
@@ -57,7 +61,7 @@ async def inspect_capabilities(server: LSPServer, client_cls: type[LSPClient]):
5761
server_available = False
5862

5963
for method in cap.methods():
60-
yield CheckResult(
64+
yield CapabilityInspectResult(
6165
capability=method,
6266
client=client_available,
6367
server=server_available,

0 commit comments

Comments
 (0)