@@ -20,6 +20,7 @@ class RobotWorkspaceProtocolPart(RobotLanguageServerProtocolPart):
2020
2121 def __init__ (self , parent : RobotLanguageServerProtocol ) -> None :
2222 super ().__init__ (parent )
23+ # self.parent.on_initialized.add(self._on_initialized)
2324
2425 @_logger .call
2526 async def get_or_open_document (
@@ -39,3 +40,47 @@ async def get_or_open_document(
3940 return await self .parent .documents .append_document (
4041 document_uri = DocumentUri (uri ), language_id = language_id , text = text , version = version
4142 )
43+
44+ # @_logger.call
45+ # async def _on_initialized(self, sender: Any) -> None:
46+ # self.parent.workspace.did_change_configuration.add(self._on_change_configuration)
47+
48+ # @_logger.call
49+ # @threaded()
50+ # async def _on_change_configuration(self, sender: Any, settings: Dict[str, Any]) -> None:
51+ # async def run() -> None:
52+ # await asyncio.sleep(1)
53+ # token = await self.parent.window.create_progress()
54+
55+ # self.parent.window.progress_begin(token, "Analyze files")
56+ # try:
57+ # for folder in self.parent.workspace.workspace_folders:
58+ # config = (
59+ # await self.parent.workspace.get_configuration(WorkspaceConfig, folder.uri)
60+ # or WorkspaceConfig()
61+ # )
62+
63+ # async for f in iter_files(
64+ # folder.uri.to_path(),
65+ # (f"**/*.{{{ROBOT_FILE_EXTENSION[1:]},{RESOURCE_FILE_EXTENSION[1:]}}}"),
66+ # ignore_patterns=config.exclude_patterns or [], # type: ignore
67+ # absolute=True,
68+ # ):
69+ # self.parent.window.progress_report(token, "analyze "
70+ # + str(f.relative_to(folder.uri.to_path())))
71+ # try:
72+ # document = await self.get_or_open_document(f, "robotframework")
73+ # await (await self.parent.documents_cache.get_namespace(document)).ensure_initialized()
74+ # run_coroutine_in_thread(self.parent.diagnostics.publish_diagnostics, str(document.uri))
75+
76+ # except (SystemExit, KeyboardInterrupt, asyncio.CancelledError):
77+ # raise
78+ # except BaseException:
79+ # pass
80+ # except BaseException:
81+ # self.parent.window.progress_cancel(token)
82+ # raise
83+ # else:
84+ # self.parent.window.progress_end(token)
85+
86+ # await run()
0 commit comments