robotcode-robot 0.106.0__tar.gz → 0.107.0__tar.gz

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-0.106.0 → robotcode_robot-0.107.0}/PKG-INFO +2 -2
  2. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/pyproject.toml +1 -1
  3. robotcode_robot-0.107.0/src/robotcode/robot/__version__.py +1 -0
  4. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/entities.py +36 -0
  5. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/library_doc.py +0 -21
  6. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/namespace.py +16 -6
  7. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/namespace_analyzer.py +18 -0
  8. robotcode_robot-0.106.0/src/robotcode/robot/__version__.py +0 -1
  9. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/.gitignore +0 -0
  10. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/LICENSE.txt +0 -0
  11. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/README.md +0 -0
  12. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/__init__.py +0 -0
  13. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/config/__init__.py +0 -0
  14. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/config/loader.py +0 -0
  15. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/config/model.py +0 -0
  16. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/config/utils.py +0 -0
  17. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/__init__.py +0 -0
  18. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/data_cache.py +0 -0
  19. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/diagnostics_modifier.py +0 -0
  20. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/document_cache_helper.py +0 -0
  21. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/errors.py +0 -0
  22. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/imports_manager.py +0 -0
  23. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/keyword_finder.py +0 -0
  24. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/model_helper.py +0 -0
  25. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/diagnostics/workspace_config.py +0 -0
  26. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/py.typed +0 -0
  27. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/utils/__init__.py +0 -0
  28. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/utils/ast.py +0 -0
  29. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/utils/markdownformatter.py +0 -0
  30. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/utils/match.py +0 -0
  31. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/utils/robot_path.py +0 -0
  32. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/utils/stubs.py +0 -0
  33. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/utils/variables.py +0 -0
  34. {robotcode_robot-0.106.0 → robotcode_robot-0.107.0}/src/robotcode/robot/utils/visitor.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: robotcode-robot
3
- Version: 0.106.0
3
+ Version: 0.107.0
4
4
  Summary: Support classes for RobotCode for handling Robot Framework projects.
5
5
  Project-URL: Homepage, https://robotcode.io
6
6
  Project-URL: Donate, https://opencollective.com/robotcode
@@ -26,7 +26,7 @@ Classifier: Topic :: Utilities
26
26
  Classifier: Typing :: Typed
27
27
  Requires-Python: >=3.8
28
28
  Requires-Dist: platformdirs<4.4.0,>=3.2.0
29
- Requires-Dist: robotcode-core==0.106.0
29
+ Requires-Dist: robotcode-core==0.107.0
30
30
  Requires-Dist: robotframework>=4.1.0
31
31
  Requires-Dist: tomli>=1.1.0; python_version < '3.11'
32
32
  Description-Content-Type: text/markdown
@@ -30,7 +30,7 @@ dependencies = [
30
30
  "robotframework>=4.1.0",
31
31
  "tomli>=1.1.0; python_version < '3.11'",
32
32
  "platformdirs>=3.2.0,<4.4.0",
33
- "robotcode-core==0.106.0",
33
+ "robotcode-core==0.107.0",
34
34
  ]
35
35
  dynamic = ["version"]
36
36
 
@@ -0,0 +1 @@
1
+ __version__ = "0.107.0"
@@ -394,3 +394,39 @@ class VariablesEntry(LibraryEntry):
394
394
  self.import_source,
395
395
  )
396
396
  )
397
+
398
+
399
+ @dataclass
400
+ class TestCaseDefinition(SourceEntity):
401
+ name: str
402
+
403
+ @single_call
404
+ def __hash__(self) -> int:
405
+ return hash(
406
+ (
407
+ self.line_no,
408
+ self.col_offset,
409
+ self.end_line_no,
410
+ self.end_col_offset,
411
+ self.source,
412
+ self.name,
413
+ )
414
+ )
415
+
416
+
417
+ @dataclass
418
+ class TagDefinition(SourceEntity):
419
+ name: str
420
+
421
+ @single_call
422
+ def __hash__(self) -> int:
423
+ return hash(
424
+ (
425
+ self.line_no,
426
+ self.col_offset,
427
+ self.end_line_no,
428
+ self.end_col_offset,
429
+ self.source,
430
+ self.name,
431
+ )
432
+ )
@@ -2,7 +2,6 @@ from __future__ import annotations
2
2
 
3
3
  import ast
4
4
  import functools
5
- import hashlib
6
5
  import importlib
7
6
  import importlib.util
8
7
  import io
@@ -634,7 +633,6 @@ class KeywordDoc(SourceEntity):
634
633
  deprecated: bool = field(default=False, compare=False)
635
634
  return_type: Optional[str] = field(default=None, compare=False)
636
635
 
637
- parent_digest: Optional[str] = field(default=None, init=False, metadata={"nosave": True})
638
636
  parent: Optional[LibraryDoc] = field(default=None, init=False, metadata={"nosave": True})
639
637
 
640
638
  def _get_argument_definitions(self) -> Optional[List[ArgumentDefinition]]:
@@ -656,16 +654,7 @@ class KeywordDoc(SourceEntity):
656
654
  else []
657
655
  )
658
656
 
659
- digest: Optional[str] = field(init=False)
660
-
661
657
  def __post_init__(self) -> None:
662
- s = (
663
- f"{self.name}|{self.source}|{self.line_no}|"
664
- f"{self.end_line_no}|{self.col_offset}|{self.end_col_offset}|"
665
- f"{self.type}|{self.libname}|{self.libtype}"
666
- )
667
- self.digest = hashlib.sha224(s.encode("utf-8")).hexdigest()
668
-
669
658
  if self.argument_definitions is None:
670
659
  self.argument_definitions = self._get_argument_definitions()
671
660
 
@@ -1030,8 +1019,6 @@ class LibraryDoc:
1030
1019
  has_listener: Optional[bool] = None
1031
1020
  library_type: Optional[LibraryType] = None
1032
1021
 
1033
- digest: Optional[str] = field(init=False)
1034
-
1035
1022
  @property
1036
1023
  def inits(self) -> KeywordStore:
1037
1024
  return self._inits
@@ -1056,16 +1043,8 @@ class LibraryDoc:
1056
1043
 
1057
1044
  for k in keywords:
1058
1045
  k.parent = self
1059
- k.parent_digest = self.digest
1060
1046
 
1061
1047
  def __post_init__(self) -> None:
1062
- s = (
1063
- f"{self.name}|{self.source}|{self.line_no}|"
1064
- f"{self.end_line_no}|{self.version}|"
1065
- f"{self.type}|{self.scope}|{self.doc_format}"
1066
- )
1067
- self.digest = hashlib.sha224(s.encode("utf-8")).hexdigest()
1068
-
1069
1048
  self._update_keywords(self._inits)
1070
1049
  self._update_keywords(self._keywords)
1071
1050
 
@@ -72,6 +72,8 @@ from .entities import (
72
72
  LocalVariableDefinition,
73
73
  ResourceEntry,
74
74
  ResourceImport,
75
+ TagDefinition,
76
+ TestCaseDefinition,
75
77
  TestVariableDefinition,
76
78
  VariableDefinition,
77
79
  VariableMatcher,
@@ -720,6 +722,9 @@ class Namespace:
720
722
  self._local_variable_assignments: Dict[VariableDefinition, Set[Range]] = {}
721
723
  self._namespace_references: Dict[LibraryEntry, Set[Location]] = {}
722
724
 
725
+ self._test_case_definitions: List[TestCaseDefinition] = []
726
+ self._tag_definitions: List[TagDefinition] = []
727
+
723
728
  self._imported_keywords: Optional[List[KeywordDoc]] = None
724
729
  self._imported_keywords_lock = RLock(default_timeout=120, name="Namespace.imported_keywords")
725
730
  self._keywords: Optional[List[KeywordDoc]] = None
@@ -847,18 +852,21 @@ class Namespace:
847
852
 
848
853
  return self._keyword_references
849
854
 
850
- def get_variable_references(
851
- self,
852
- ) -> Dict[VariableDefinition, Set[Location]]:
855
+ def get_variable_references(self) -> Dict[VariableDefinition, Set[Location]]:
853
856
  self.ensure_initialized()
854
857
 
855
858
  self.analyze()
856
859
 
857
860
  return self._variable_references
858
861
 
859
- def get_local_variable_assignments(
860
- self,
861
- ) -> Dict[VariableDefinition, Set[Range]]:
862
+ def get_testcase_definitions(self) -> List[TestCaseDefinition]:
863
+ self.ensure_initialized()
864
+
865
+ self.analyze()
866
+
867
+ return self._test_case_definitions
868
+
869
+ def get_local_variable_assignments(self) -> Dict[VariableDefinition, Set[Range]]:
862
870
  self.ensure_initialized()
863
871
 
864
872
  self.analyze()
@@ -1910,6 +1918,8 @@ class Namespace:
1910
1918
  self._variable_references = result.variable_references
1911
1919
  self._local_variable_assignments = result.local_variable_assignments
1912
1920
  self._namespace_references = result.namespace_references
1921
+ self._test_case_definitions = result.test_case_definitions
1922
+ self._tag_definitions = result.tag_definitions
1913
1923
 
1914
1924
  lib_doc = self.get_library_doc()
1915
1925
 
@@ -63,6 +63,8 @@ from .entities import (
63
63
  InvalidVariableError,
64
64
  LibraryEntry,
65
65
  LocalVariableDefinition,
66
+ TagDefinition,
67
+ TestCaseDefinition,
66
68
  TestVariableDefinition,
67
69
  VariableDefinition,
68
70
  VariableDefinitionType,
@@ -92,6 +94,8 @@ class AnalyzerResult:
92
94
  variable_references: Dict[VariableDefinition, Set[Location]]
93
95
  local_variable_assignments: Dict[VariableDefinition, Set[Range]]
94
96
  namespace_references: Dict[LibraryEntry, Set[Location]]
97
+ test_case_definitions: List[TestCaseDefinition]
98
+ tag_definitions: List[TagDefinition]
95
99
 
96
100
  # TODO Tag references
97
101
 
@@ -121,6 +125,8 @@ class NamespaceAnalyzer(Visitor):
121
125
  self._variable_references: Dict[VariableDefinition, Set[Location]] = defaultdict(set)
122
126
  self._local_variable_assignments: Dict[VariableDefinition, Set[Range]] = defaultdict(set)
123
127
  self._namespace_references: Dict[LibraryEntry, Set[Location]] = defaultdict(set)
128
+ self._test_case_definitions: List[TestCaseDefinition] = []
129
+ self._tag_definitions: List[TagDefinition] = []
124
130
 
125
131
  self._variables: Dict[VariableMatcher, VariableDefinition] = {
126
132
  **{v.matcher: v for v in self._namespace.get_builtin_variables()},
@@ -166,6 +172,8 @@ class NamespaceAnalyzer(Visitor):
166
172
  self._variable_references,
167
173
  self._local_variable_assignments,
168
174
  self._namespace_references,
175
+ self._test_case_definitions,
176
+ self._tag_definitions,
169
177
  )
170
178
 
171
179
  def _visit_VariableSection(self, node: VariableSection) -> None: # noqa: N802
@@ -1048,6 +1056,16 @@ class NamespaceAnalyzer(Visitor):
1048
1056
  name_token = node.get_token(Token.TESTCASE_NAME)
1049
1057
  if name_token is not None and name_token.value:
1050
1058
  self._analyze_token_variables(name_token, DiagnosticSeverity.HINT)
1059
+ self._test_case_definitions.append(
1060
+ TestCaseDefinition(
1061
+ line_no=name_token.lineno,
1062
+ col_offset=name_token.col_offset,
1063
+ end_line_no=name_token.lineno,
1064
+ end_col_offset=name_token.end_col_offset,
1065
+ source=self._namespace.source,
1066
+ name=name_token.value,
1067
+ )
1068
+ )
1051
1069
 
1052
1070
  @functools.cached_property
1053
1071
  def _namespace_lib_doc(self) -> LibraryDoc:
@@ -1 +0,0 @@
1
- __version__ = "0.106.0"