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
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,30 @@
"default": true,
"description": "Enable/disable whether Robot Framework tests and tasks are integrated into the VSCode Test/Test Explorer view.",
"scope": "resource"
},
"robotcode.testExplorer.fastDiscovery.enabled": {
"type": "boolean",
"default": false,
"description": "Experimental optimization for very large workspaces. Prefilters files containing Test Cases/Tasks before full discovery.",
"scope": "resource"
},
"robotcode.testExplorer.fastDiscovery.prefilterCommand": {
"type": "string",
"enum": [
"auto",
"gitGrep",
"grep",
"none"
],
"default": "auto",
"markdownDescription": "Selects prefilter command for fast discovery. `auto` tries `git grep` first, then `grep`, and falls back to normal discovery if unavailable. `none` disables prefiltering.",
"scope": "resource"
},
"robotcode.testExplorer.fastDiscovery.command.enabled": {
"type": "boolean",
"default": false,
"description": "Use `robotcode discover fast` for workspace discovery when fast discovery prefiltering is enabled. Automatically falls back to full discovery if unsupported options are detected.",
"scope": "resource"
}
}
}
Expand Down
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
16 changes: 15 additions & 1 deletion packages/robot/src/robotcode/robot/config/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from pathlib import Path
from typing import Callable, Optional, Sequence, Tuple, Union

Expand Down Expand Up @@ -72,7 +73,20 @@ def get_config_files(
else:
verbose_callback("No configuration files found.")

user_config = get_user_config_file(verbose_callback=verbose_callback)
disable_user_config_create = os.getenv("ROBOTCODE_DISABLE_USER_CONFIG_CREATE", "").lower() in [
"on",
"1",
"yes",
"true",
]

if disable_user_config_create and verbose_callback:
verbose_callback(
"Automatic creation of user configuration is disabled by "
"ROBOTCODE_DISABLE_USER_CONFIG_CREATE."
)

user_config = get_user_config_file(create=not disable_user_config_create, verbose_callback=verbose_callback)

return (
[
Expand Down
Loading