Skip to content

Commit d2f8114

Browse files
d-biehlpetrieh
andcommitted
fix(analysis): respect diagnosticMode for workspace files
Diagnostics for closed workspace files could appear (or be suppressed) inconsistently in openFilesOnly mode, depending on which file the workspace diagnostics loop happened to iterate last. Also clarify the diagnosticMode description so it no longer implies that background analysis is restricted -- the setting only controls which files diagnostics are reported for. Co-authored-by: Petri Huovinen <petri.huovinen@nokia.com>
1 parent 4dcb22f commit d2f8114

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,8 @@
11281128
],
11291129
"default": "openFilesOnly",
11301130
"enumDescriptions": [
1131-
"Analyzes and reports problems only on open files.",
1132-
"Analyzes and reports problems on all files in the workspace."
1131+
"Reports problems only on open files.",
1132+
"Reports problems on all files in the workspace."
11331133
],
11341134
"description": "Analysis mode for diagnostics.",
11351135
"scope": "resource"

packages/language_server/src/robotcode/language_server/common/parts/diagnostics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def run_workspace_diagnostics(self) -> None:
436436
documents_to_collect = [
437437
doc
438438
for doc in documents
439-
if doc.opened_in_editor or self.get_diagnostics_mode(document.uri) == DiagnosticsMode.WORKSPACE
439+
if doc.opened_in_editor or self.get_diagnostics_mode(doc.uri) == DiagnosticsMode.WORKSPACE
440440
]
441441

442442
with self._logger.measure_time(

0 commit comments

Comments
 (0)