4
4
import asyncio
5
5
from typing import TYPE_CHECKING , Any , List , Optional
6
6
7
- from ....utils .async_tools import check_canceled , threaded
7
+ from ....utils .async_tools import check_canceled , create_sub_task , threaded
8
8
from ....utils .logging import LoggingDescriptor
9
9
from ....utils .uri import Uri
10
10
from ...common .decorators import language_id
@@ -51,10 +51,7 @@ def __init__(self, parent: RobotLanguageServerProtocol) -> None:
51
51
52
52
parent .documents_cache .namespace_invalidated .add (self .namespace_invalidated )
53
53
54
- @language_id ("robotframework" )
55
- @threaded ()
56
- @_logger .call
57
- async def namespace_invalidated (self , sender : Any , namespace : Namespace ) -> None :
54
+ async def namespace_invalidated_task (self , namespace : Namespace ) -> None :
58
55
if namespace .document is not None :
59
56
refresh = namespace .document .opened_in_editor
60
57
@@ -72,6 +69,11 @@ async def namespace_invalidated(self, sender: Any, namespace: Namespace) -> None
72
69
if refresh :
73
70
await self .parent .diagnostics .refresh ()
74
71
72
+ @language_id ("robotframework" )
73
+ @_logger .call
74
+ async def namespace_invalidated (self , sender : Any , namespace : Namespace ) -> None :
75
+ create_sub_task (self .namespace_invalidated_task (namespace ), loop = self .parent .diagnostics .diagnostics_loop )
76
+
75
77
@language_id ("robotframework" )
76
78
@threaded ()
77
79
@_logger .call
0 commit comments