robotcode-robot 2.7.0__py3-none-any.whl → 2.8.0.dev8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. robotcode/robot/__version__.py +1 -1
  2. robotcode/robot/config/loader.py +18 -5
  3. robotcode/robot/config/model.py +360 -112
  4. robotcode/robot/diagnostics/analyzer_result.py +6 -1
  5. robotcode/robot/diagnostics/data_cache.py +12 -1
  6. robotcode/robot/diagnostics/diagnostic_rules.py +75 -0
  7. robotcode/robot/diagnostics/diagnostics_modifier.py +83 -43
  8. robotcode/robot/diagnostics/document_cache_helper.py +86 -8
  9. robotcode/robot/diagnostics/entities.py +20 -4
  10. robotcode/robot/diagnostics/errors.py +7 -0
  11. robotcode/robot/diagnostics/import_resolver.py +163 -26
  12. robotcode/robot/diagnostics/imports_manager.py +352 -116
  13. robotcode/robot/diagnostics/library_doc.py +877 -162
  14. robotcode/robot/diagnostics/namespace.py +65 -29
  15. robotcode/robot/diagnostics/namespace_analyzer.py +101 -29
  16. robotcode/robot/diagnostics/project_index.py +88 -13
  17. robotcode/robot/diagnostics/scope_tree.py +2 -2
  18. robotcode/robot/diagnostics/semantic_analyzer/analyzer.py +866 -214
  19. robotcode/robot/diagnostics/semantic_analyzer/enums.py +40 -2
  20. robotcode/robot/diagnostics/semantic_analyzer/json_dump.py +364 -0
  21. robotcode/robot/diagnostics/semantic_analyzer/model.py +113 -12
  22. robotcode/robot/diagnostics/semantic_analyzer/nodes.py +55 -1
  23. robotcode/robot/diagnostics/semantic_analyzer/serialization.py +25 -11
  24. robotcode/robot/diagnostics/semantic_analyzer/variable_tokenizer.py +218 -112
  25. robotcode/robot/diagnostics/workspace_config.py +3 -0
  26. robotcode/robot/utils/markdown_docs.py +733 -0
  27. robotcode/robot/utils/markdownformatter.py +57 -12
  28. robotcode/robot/utils/match.py +13 -0
  29. robotcode/robot/utils/robot_patching.py +4 -0
  30. robotcode/robot/utils/variables.py +12 -0
  31. {robotcode_robot-2.7.0.dist-info → robotcode_robot-2.8.0.dev8.dist-info}/METADATA +4 -3
  32. robotcode_robot-2.8.0.dev8.dist-info/RECORD +48 -0
  33. {robotcode_robot-2.7.0.dist-info → robotcode_robot-2.8.0.dev8.dist-info}/WHEEL +1 -1
  34. robotcode_robot-2.7.0.dist-info/RECORD +0 -46
@@ -1 +1 @@
1
- __version__ = "2.7.0"
1
+ __version__ = "2.8.0-dev.8"
@@ -1,7 +1,7 @@
1
1
  import sys
2
2
  from dataclasses import fields, is_dataclass
3
3
  from enum import Enum
4
- from pathlib import Path
4
+ from pathlib import Path, PurePath
5
5
  from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, TypeVar, Union
6
6
 
7
7
  from robotcode.core.utils.dataclasses import from_dict
@@ -213,6 +213,20 @@ def load_robot_config_from_path(
213
213
  )
214
214
 
215
215
 
216
+ _TPath = TypeVar("_TPath", bound=PurePath)
217
+
218
+
219
+ def _find_common_base(src_parents: Sequence[Sequence[_TPath]]) -> Optional[_TPath]:
220
+ """The deepest folder all sources have in common.
221
+
222
+ Sources on different drives (Windows) have nothing in common.
223
+ """
224
+ common = set.intersection(*(set(parents) for parents in src_parents))
225
+ if not common:
226
+ return None
227
+ return max(common, key=lambda path: path.parts)
228
+
229
+
216
230
  def find_project_root(
217
231
  *sources: Union[str, Path],
218
232
  root_folder: Optional[Path] = None,
@@ -228,10 +242,9 @@ def find_project_root(
228
242
 
229
243
  src_parents = [list(path.parents) + ([path] if path.is_dir() else []) for path in path_srcs]
230
244
 
231
- common_base = max(
232
- set.intersection(*(set(parents) for parents in src_parents)),
233
- key=lambda path: path.parts,
234
- )
245
+ common_base = _find_common_base(src_parents)
246
+ if common_base is None:
247
+ return None, DiscoverdBy.NOT_FOUND
235
248
 
236
249
  for directory in (common_base, *common_base.parents):
237
250
  if (directory / LOCAL_ROBOT_TOML).is_file():