robotcode-robot 2.9.0.dev197__tar.gz → 2.9.0.dev230__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.
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/.gitignore +1 -1
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/PKG-INFO +2 -2
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/pyproject.toml +1 -1
- robotcode_robot-2.9.0.dev230/src/robotcode/robot/__version__.py +1 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/diagnostic_rules.py +6 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/document_cache_helper.py +2 -1
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/imports_manager.py +2 -2
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/library_doc.py +8 -3
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/namespace_analyzer.py +2 -3
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/semantic_analyzer/analyzer.py +2 -3
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/document_formats.py +0 -19
- robotcode_robot-2.9.0.dev230/src/robotcode/robot/language_definitions.py +39 -0
- robotcode_robot-2.9.0.dev197/src/robotcode/robot/__version__.py +0 -1
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/README.md +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/__init__.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/config/__init__.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/config/loader.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/config/model.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/config/utils.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/__init__.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/analyzer_result.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/data_cache.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/diagnostics_modifier.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/entities.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/errors.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/import_resolver.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/keyword_finder.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/model_helper.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/namespace.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/project_index.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/scope_tree.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/semantic_analyzer/__init__.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/semantic_analyzer/enums.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/semantic_analyzer/json_dump.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/semantic_analyzer/model.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/semantic_analyzer/nodes.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/semantic_analyzer/run_keyword.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/semantic_analyzer/serialization.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/semantic_analyzer/variable_tokenizer.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/variable_scope.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/diagnostics/workspace_config.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/py.typed +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/__init__.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/ast.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/markdown_blocks.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/markdown_docs.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/markdownformatter.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/match.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/robot_patching.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/robot_path.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/stubs.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/variables.py +0 -0
- {robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/visitor.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: robotcode-robot
|
|
3
|
-
Version: 2.9.0-dev.
|
|
3
|
+
Version: 2.9.0-dev.230
|
|
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
|
|
@@ -27,7 +27,7 @@ Classifier: Topic :: Utilities
|
|
|
27
27
|
Classifier: Typing :: Typed
|
|
28
28
|
Requires-Python: >=3.10
|
|
29
29
|
Requires-Dist: platformdirs>=4.3
|
|
30
|
-
Requires-Dist: robotcode-core==2.9.0-dev.
|
|
30
|
+
Requires-Dist: robotcode-core==2.9.0-dev.230
|
|
31
31
|
Requires-Dist: robotframework>=5.0.0
|
|
32
32
|
Requires-Dist: tomli>=1.1.0; python_version < '3.11'
|
|
33
33
|
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.9.0-dev.230"
|
|
@@ -35,6 +35,12 @@ def private_keyword_call_message(keyword: KeywordDoc, source: Optional[str]) ->
|
|
|
35
35
|
return None
|
|
36
36
|
|
|
37
37
|
|
|
38
|
+
def deprecated_keyword_message(keyword: KeywordDoc) -> str:
|
|
39
|
+
"""The `DeprecatedKeyword` message for a call of `keyword`, in the form of Robot Framework's warning."""
|
|
40
|
+
reason = keyword.deprecated_message
|
|
41
|
+
return f"Keyword '{keyword.name}' is deprecated.{f' {reason}' if reason else ''}"
|
|
42
|
+
|
|
43
|
+
|
|
38
44
|
# The section headers of keyword documentation, as Robot Framework 7.5 recognizes them.
|
|
39
45
|
_DOC_SECTION_HEADER = re.compile(
|
|
40
46
|
r"[*_]*(args|arguments|parameters|returns|return|yields|raises|raise|tags)[*_]*::?[*_]*(\s+.*)?",
|
|
@@ -35,7 +35,8 @@ from robotcode.robot.diagnostics.diagnostics_modifier import (
|
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
from ..config.model import RobotBaseProfile
|
|
38
|
-
from ..document_formats import
|
|
38
|
+
from ..document_formats import is_markdown_file
|
|
39
|
+
from ..language_definitions import MARKDOWN_LANGUAGE_ID
|
|
39
40
|
from ..utils import RF_VERSION
|
|
40
41
|
from ..utils.markdown_blocks import RobotBlock, find_robot_blocks, read_markdown_data
|
|
41
42
|
from ..utils.stubs import Languages
|
|
@@ -56,7 +56,7 @@ from robotcode.core.utils.path import (
|
|
|
56
56
|
)
|
|
57
57
|
|
|
58
58
|
from ..__version__ import __version__
|
|
59
|
-
from ..
|
|
59
|
+
from ..language_definitions import ROBOT_LANGUAGE_IDS
|
|
60
60
|
from ..utils import RF_VERSION
|
|
61
61
|
from ..utils.robot_path import find_file_ex
|
|
62
62
|
from ..utils.stubs import Languages
|
|
@@ -1273,7 +1273,7 @@ class ImportsManager:
|
|
|
1273
1273
|
# unresolved imports (file didn't exist yet) get invalidated and re-analyzed.
|
|
1274
1274
|
self.imports_changed(self, uri)
|
|
1275
1275
|
|
|
1276
|
-
@language_id(
|
|
1276
|
+
@language_id(*ROBOT_LANGUAGE_IDS)
|
|
1277
1277
|
def _on_possible_resource_document_modified(self, sender: Any, document: TextDocument) -> None:
|
|
1278
1278
|
run_as_task(self.__on_possible_resource_document_modified, sender, document)
|
|
1279
1279
|
|
|
@@ -66,6 +66,7 @@ from robot.utils.escaping import unescape
|
|
|
66
66
|
from robot.utils.htmlformatters import HeaderFormatter as RobotHeaderFormatter
|
|
67
67
|
from robot.utils.importer import Importer
|
|
68
68
|
from robot.utils.robotpath import find_file as robot_find_file
|
|
69
|
+
from robot.utils.text import getshortdoc
|
|
69
70
|
from robot.variables import Variables
|
|
70
71
|
from robot.variables.filesetter import PythonImporter, YamlImporter
|
|
71
72
|
from robot.variables.finders import VariableFinder
|
|
@@ -1110,9 +1111,13 @@ class KeywordDoc(SourceEntity):
|
|
|
1110
1111
|
|
|
1111
1112
|
@property
|
|
1112
1113
|
def deprecated_message(self) -> str:
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1114
|
+
# Robot Framework's run-time warning takes the text after the closing `*` of the short doc;
|
|
1115
|
+
# BuiltIn writes its reason between the asterisks, so that is the fallback.
|
|
1116
|
+
short_doc: str = getshortdoc(self.doc)
|
|
1117
|
+
if not short_doc.startswith("*DEPRECATED") or "*" not in short_doc[1:]:
|
|
1118
|
+
return ""
|
|
1119
|
+
_, marker, after = short_doc.split("*", 2)
|
|
1120
|
+
return after.strip() or marker[len("DEPRECATED") :].strip()
|
|
1116
1121
|
|
|
1117
1122
|
@property
|
|
1118
1123
|
def name_range(self) -> Range:
|
|
@@ -70,7 +70,7 @@ from ..utils.variables import (
|
|
|
70
70
|
)
|
|
71
71
|
from ..utils.visitor import Visitor
|
|
72
72
|
from .analyzer_result import AnalyzerResult
|
|
73
|
-
from .diagnostic_rules import private_keyword_call_message, tags_row_without_empty_row
|
|
73
|
+
from .diagnostic_rules import deprecated_keyword_message, private_keyword_call_message, tags_row_without_empty_row
|
|
74
74
|
from .entities import (
|
|
75
75
|
ArgumentDefinition,
|
|
76
76
|
BuiltInVariableDefinition,
|
|
@@ -897,8 +897,7 @@ class NamespaceAnalyzer(Visitor):
|
|
|
897
897
|
if result.is_deprecated:
|
|
898
898
|
self._append_diagnostics(
|
|
899
899
|
range=kw_range,
|
|
900
|
-
message=
|
|
901
|
-
f"{f': {result.deprecated_message}' if result.deprecated_message else ''}.",
|
|
900
|
+
message=deprecated_keyword_message(result),
|
|
902
901
|
severity=DiagnosticSeverity.HINT,
|
|
903
902
|
tags=[DiagnosticTag.DEPRECATED],
|
|
904
903
|
code=Error.DEPRECATED_KEYWORD,
|
|
@@ -107,7 +107,7 @@ from ...utils.variables import (
|
|
|
107
107
|
)
|
|
108
108
|
from ...utils.visitor import Visitor
|
|
109
109
|
from ..analyzer_result import AnalyzerResult
|
|
110
|
-
from ..diagnostic_rules import private_keyword_call_message, tags_row_without_empty_row
|
|
110
|
+
from ..diagnostic_rules import deprecated_keyword_message, private_keyword_call_message, tags_row_without_empty_row
|
|
111
111
|
from ..entities import (
|
|
112
112
|
ArgumentDefinition,
|
|
113
113
|
BuiltInVariableDefinition,
|
|
@@ -2241,8 +2241,7 @@ class SemanticAnalyzer(Visitor):
|
|
|
2241
2241
|
if result.is_deprecated:
|
|
2242
2242
|
self._append_diagnostics(
|
|
2243
2243
|
range=kw_range,
|
|
2244
|
-
message=
|
|
2245
|
-
f"{f': {result.deprecated_message}' if result.deprecated_message else ''}.",
|
|
2244
|
+
message=deprecated_keyword_message(result),
|
|
2246
2245
|
severity=DiagnosticSeverity.HINT,
|
|
2247
2246
|
tags=[DiagnosticTag.DEPRECATED],
|
|
2248
2247
|
code=Error.DEPRECATED_KEYWORD,
|
|
@@ -4,7 +4,6 @@ from pathlib import Path
|
|
|
4
4
|
from typing import Callable, Dict, List, Optional, Tuple, Union
|
|
5
5
|
|
|
6
6
|
from robot.running.builder import TestSuiteBuilder
|
|
7
|
-
from robotcode.core.language import LanguageDefinition
|
|
8
7
|
from robotcode.core.utils.dataclasses import CamelSnakeMixin
|
|
9
8
|
|
|
10
9
|
from .config.model import RobotBaseProfile, StringExpression
|
|
@@ -33,9 +32,6 @@ def _robot_framework_formats() -> Tuple[Tuple[str, ...], Dict[str, str]]:
|
|
|
33
32
|
|
|
34
33
|
DEFAULT_EXTENSIONS, _FORMAT_OF_EXTENSION = _robot_framework_formats()
|
|
35
34
|
|
|
36
|
-
# the language of the Markdown files Robot Framework parses; no editor sends it, the server detects it by file name
|
|
37
|
-
MARKDOWN_LANGUAGE_ID = "robotframework-markdown"
|
|
38
|
-
|
|
39
35
|
|
|
40
36
|
@dataclass(frozen=True)
|
|
41
37
|
class DocumentFormat(CamelSnakeMixin):
|
|
@@ -106,21 +102,6 @@ def parse_include_condition(profile: RobotBaseProfile, root: Path) -> Optional[C
|
|
|
106
102
|
return condition
|
|
107
103
|
|
|
108
104
|
|
|
109
|
-
def markdown_language_definition(profile: RobotBaseProfile, root: Path) -> Optional[LanguageDefinition]:
|
|
110
|
-
"""The language of the Markdown files Robot Framework parses with the profile in the project `root`; `None` when
|
|
111
|
-
no Markdown extension is active."""
|
|
112
|
-
extensions = [f".{e}" for e in markdown_extensions(profile)]
|
|
113
|
-
if not extensions:
|
|
114
|
-
return None
|
|
115
|
-
|
|
116
|
-
return LanguageDefinition(
|
|
117
|
-
id=MARKDOWN_LANGUAGE_ID,
|
|
118
|
-
extensions=extensions,
|
|
119
|
-
extensions_ignore_case=True,
|
|
120
|
-
file_condition=parse_include_condition(profile, root),
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
|
|
124
105
|
def is_markdown_file(path: Path) -> bool:
|
|
125
106
|
"""Whether Robot Framework reads the file with its Markdown parser, from its code blocks.
|
|
126
107
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""The languages RobotCode serves: their ids and their language definitions."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Final, Optional
|
|
5
|
+
|
|
6
|
+
from robotcode.core.language import LanguageDefinition
|
|
7
|
+
|
|
8
|
+
from .config.model import RobotBaseProfile
|
|
9
|
+
from .document_formats import markdown_extensions, parse_include_condition
|
|
10
|
+
|
|
11
|
+
ROBOTFRAMEWORK_LANGUAGE_ID = "robotframework"
|
|
12
|
+
|
|
13
|
+
ROBOTFRAMEWORK_LANGUAGE = LanguageDefinition(
|
|
14
|
+
id=ROBOTFRAMEWORK_LANGUAGE_ID,
|
|
15
|
+
extensions=[".robot", ".resource"],
|
|
16
|
+
extensions_ignore_case=True,
|
|
17
|
+
aliases=["Robot Framework", "robotframework"],
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
# the language of the Markdown files Robot Framework parses; no editor sends it, the server detects it by file name
|
|
21
|
+
MARKDOWN_LANGUAGE_ID = "robotframework-markdown"
|
|
22
|
+
|
|
23
|
+
# the languages whose documents hold Robot Framework data
|
|
24
|
+
ROBOT_LANGUAGE_IDS: Final = (ROBOTFRAMEWORK_LANGUAGE_ID, MARKDOWN_LANGUAGE_ID)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def markdown_language_definition(profile: RobotBaseProfile, root: Path) -> Optional[LanguageDefinition]:
|
|
28
|
+
"""The language of the Markdown files Robot Framework parses with the profile in the project `root`; `None` when
|
|
29
|
+
no Markdown extension is active."""
|
|
30
|
+
extensions = [f".{e}" for e in markdown_extensions(profile)]
|
|
31
|
+
if not extensions:
|
|
32
|
+
return None
|
|
33
|
+
|
|
34
|
+
return LanguageDefinition(
|
|
35
|
+
id=MARKDOWN_LANGUAGE_ID,
|
|
36
|
+
extensions=extensions,
|
|
37
|
+
extensions_ignore_case=True,
|
|
38
|
+
file_condition=parse_include_condition(profile, root),
|
|
39
|
+
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.9.0-dev.197"
|
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/__init__.py
RENAMED
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/config/__init__.py
RENAMED
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/config/loader.py
RENAMED
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/config/model.py
RENAMED
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/config/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/__init__.py
RENAMED
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/ast.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/match.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/stubs.py
RENAMED
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/variables.py
RENAMED
|
File without changes
|
{robotcode_robot-2.9.0.dev197 → robotcode_robot-2.9.0.dev230}/src/robotcode/robot/utils/visitor.py
RENAMED
|
File without changes
|