1- from __future__ import annotations
2-
31import inspect
42import typing
53import uuid
64from 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
86
97from robotcode .core .concurrent import threaded
108from robotcode .core .lsp .types import (
2422 from robotcode .language_server .common .protocol import LanguageServerProtocol
2523
2624
27- _FUNC_TYPE = Callable [..., Awaitable [ Optional [LSPAny ] ]]
25+ _FUNC_TYPE = Callable [..., Optional [LSPAny ]]
2826
2927
3028@dataclass
@@ -38,7 +36,7 @@ class CommandsProtocolPart(LanguageServerProtocolPart):
3836
3937 PREFIX : Final = f"{ uuid .uuid4 ()} "
4038
41- def __init__ (self , parent : LanguageServerProtocol ) -> None :
39+ def __init__ (self , parent : " LanguageServerProtocol" ) -> None :
4240 super ().__init__ (parent )
4341 self .commands : Dict [str , CommandEntry ] = {}
4442
@@ -72,7 +70,7 @@ def extend_capabilities(self, capabilities: ServerCapabilities) -> None:
7270
7371 @rpc_method (name = "workspace/executeCommand" , param_type = ExecuteCommandParams )
7472 @threaded
75- async def _workspace_execute_command (
73+ def _workspace_execute_command (
7674 self , command : str , arguments : Optional [List [LSPAny ]], * args : Any , ** kwargs : Any
7775 ) -> Optional [LSPAny ]:
7876 self ._logger .debug (lambda : f"execute command { command } " )
@@ -91,4 +89,4 @@ async def _workspace_execute_command(
9189 if i < len (arguments ):
9290 command_args .append (from_dict (arguments [i ], type_hints [i ]))
9391
94- return await entry .callback (* command_args )
92+ return entry .callback (* command_args )
0 commit comments