Skip to content

Commit 5b72148

Browse files
committed
fix(langserver): filewatcher does not work
1 parent 0bbc1e9 commit 5b72148

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: packages/language_server/src/robotcode/language_server/robotframework/parts/documents_cache.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DocumentsCachePart(RobotLanguageServerProtocolPart, DocumentsCacheHelper):
2626

2727
def __init__(self, parent: "RobotLanguageServerProtocol") -> None:
2828
super().__init__(parent)
29-
DocumentsCacheHelper.__init__(self, parent.workspace, parent.documents, parent.robot_profile)
29+
DocumentsCacheHelper.__init__(self, parent.workspace, parent.documents, parent.workspace, parent.robot_profile)
3030

3131
self._imports_managers_lock = threading.RLock()
3232
self._imports_managers: weakref.WeakKeyDictionary[WorkspaceFolder, ImportsManager] = weakref.WeakKeyDictionary()

Diff for: packages/robot/src/robotcode/robot/diagnostics/document_cache_helper.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from robot.parsing.lexer.tokens import Token
2222
from robotcode.core.documents_manager import DocumentsManager
2323
from robotcode.core.event import event
24+
from robotcode.core.filewatcher import FileWatcherManagerBase
2425
from robotcode.core.language import language_id_filter
2526
from robotcode.core.text_document import TextDocument
2627
from robotcode.core.uri import Uri
@@ -46,11 +47,14 @@ def __init__(
4647
self,
4748
workspace: Workspace,
4849
documents_manager: DocumentsManager,
50+
file_watcher_manager: FileWatcherManagerBase,
4951
robot_profile: Optional[RobotBaseProfile],
5052
) -> None:
5153
self.workspace = workspace
52-
self.robot_profile = robot_profile or RobotBaseProfile()
5354
self.documents_manager = documents_manager
55+
self.file_watcher_manager = file_watcher_manager
56+
57+
self.robot_profile = robot_profile or RobotBaseProfile()
5458

5559
self._imports_managers_lock = threading.RLock()
5660
self._imports_managers: weakref.WeakKeyDictionary[WorkspaceFolder, ImportsManager] = weakref.WeakKeyDictionary()
@@ -473,7 +477,7 @@ def create_imports_manager(self, root_uri: Uri) -> ImportsManager:
473477

474478
return ImportsManager(
475479
self.documents_manager,
476-
None,
480+
self.file_watcher_manager,
477481
self,
478482
root_uri.to_path(),
479483
variables,

0 commit comments

Comments
 (0)