Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,15 @@ def run_workspace_diagnostics(self) -> None:
self._break_diagnostics_loop_event.clear()

documents = sorted(
[doc for doc in self.parent.documents.documents if self._doc_need_update(doc)],
[
doc
for doc in self.parent.documents.documents
if self._doc_need_update(doc)
and (
doc.opened_in_editor
or self.get_diagnostics_mode(doc.uri) == DiagnosticsMode.WORKSPACE
)
],
key=lambda d: not d.opened_in_editor,
)

Expand Down Expand Up @@ -436,7 +444,7 @@ def run_workspace_diagnostics(self) -> None:
documents_to_collect = [
doc
for doc in documents
if doc.opened_in_editor or self.get_diagnostics_mode(document.uri) == DiagnosticsMode.WORKSPACE
if doc.opened_in_editor or self.get_diagnostics_mode(doc.uri) == DiagnosticsMode.WORKSPACE
]

with self._logger.measure_time(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ def load_workspace_documents(self, sender: Any) -> None:
for folder in self.parent.workspace.workspace_folders:
config = self.parent.workspace.get_configuration(RobotCodeConfig, folder.uri)

if config.analysis.diagnostic_mode != DiagnosticsMode.WORKSPACE:
self._logger.debug(
lambda: (
f"Skip loading workspace documents for {folder.uri.to_path()} "
f"because analysis.diagnosticMode={config.analysis.diagnostic_mode.value!r}"
),
context_name="load_workspace_documents",
)
continue

extensions = [ROBOT_FILE_EXTENSION, RESOURCE_FILE_EXTENSION]

exclude_patterns = [
Expand Down