File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import itertools
4+ from collections .abc import AsyncGenerator
45
56from attrs import frozen
67
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 ,
You can’t perform that action at this time.
0 commit comments