1
- from __future__ import annotations
2
-
3
1
import inspect
4
2
import typing
5
3
import uuid
6
4
from dataclasses import dataclass
7
- from typing import TYPE_CHECKING , Any , Awaitable , Callable , Dict , Final , List , Optional , cast
5
+ from typing import TYPE_CHECKING , Any , Callable , Dict , Final , List , Optional , cast
8
6
9
7
from robotcode .core .concurrent import threaded
10
8
from robotcode .core .lsp .types import (
24
22
from robotcode .language_server .common .protocol import LanguageServerProtocol
25
23
26
24
27
- _FUNC_TYPE = Callable [..., Awaitable [ Optional [LSPAny ] ]]
25
+ _FUNC_TYPE = Callable [..., Optional [LSPAny ]]
28
26
29
27
30
28
@dataclass
@@ -38,7 +36,7 @@ class CommandsProtocolPart(LanguageServerProtocolPart):
38
36
39
37
PREFIX : Final = f"{ uuid .uuid4 ()} "
40
38
41
- def __init__ (self , parent : LanguageServerProtocol ) -> None :
39
+ def __init__ (self , parent : " LanguageServerProtocol" ) -> None :
42
40
super ().__init__ (parent )
43
41
self .commands : Dict [str , CommandEntry ] = {}
44
42
@@ -72,7 +70,7 @@ def extend_capabilities(self, capabilities: ServerCapabilities) -> None:
72
70
73
71
@rpc_method (name = "workspace/executeCommand" , param_type = ExecuteCommandParams )
74
72
@threaded
75
- async def _workspace_execute_command (
73
+ def _workspace_execute_command (
76
74
self , command : str , arguments : Optional [List [LSPAny ]], * args : Any , ** kwargs : Any
77
75
) -> Optional [LSPAny ]:
78
76
self ._logger .debug (lambda : f"execute command { command } " )
@@ -91,4 +89,4 @@ async def _workspace_execute_command(
91
89
if i < len (arguments ):
92
90
command_args .append (from_dict (arguments [i ], type_hints [i ]))
93
91
94
- return await entry .callback (* command_args )
92
+ return entry .callback (* command_args )
0 commit comments