Skip to content

Commit e6ffef7

Browse files
committed
feat: basic support for Robot Framework 7.3
1 parent e5631f0 commit e6ffef7

File tree

1,514 files changed

+179035
-42
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,514 files changed

+179035
-42
lines changed

hatch.toml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,12 @@ generate-tmlanguage = "python ./scripts/generate_tmlanguage.py"
4646
python = "3.13"
4747
extra-dependencies = ["robotframework==7.2rc1"]
4848

49-
[envs.rfmaster313]
50-
python = "3.13"
51-
extra-dependencies = [
52-
"robotframework @ git+https://github.com/robotframework/robotframework.git",
53-
]
54-
5549
[envs.rfmaster]
5650
python = "3.12"
5751
extra-dependencies = [
5852
"robotframework @ git+https://github.com/robotframework/robotframework.git",
5953
]
6054

61-
[envs.pypy]
62-
python = "pypy3.10"
63-
extra-dependencies = ["robotframework==6.0"]
64-
6555
[envs.rfdevel]
6656
python = "3.11"
6757
post-install-commands = ["pip install -U -e {root:uri}/../robotframework"]
@@ -75,63 +65,69 @@ python = "3.8"
7565

7666
[[envs.devel.matrix]]
7767
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
78-
rf = ["rf41", "rf50", "rf60", "rf61", "rf70", "rf71", "rf72"]
68+
rf = ["rf41", "rf50", "rf60", "rf61", "rf70", "rf71", "rf72", "rf73"]
7969

8070
[envs.devel.overrides]
8171
matrix.rf.dependencies = [
82-
{ value = "robotframework>=4.1.0, <5.0", if = [
72+
{ value = "robotframework~=4.1.0", if = [
8373
"rf41",
8474
] },
85-
{ value = "robotframework>=5.0.0, <6.0", if = [
75+
{ value = "robotframework~=5.0.0", if = [
8676
"rf50",
8777
] },
88-
{ value = "robotframework>6.0.0, <6.1", if = [
78+
{ value = "robotframework~=6.0.0", if = [
8979
"rf60",
9080
] },
91-
{ value = "robotframework>=6.1, <7.0", if = [
81+
{ value = "robotframework~=6.1.0", if = [
9282
"rf61",
9383
] },
94-
{ value = "robotframework>=7.0, <7.1", if = [
84+
{ value = "robotframework~=7.0.0", if = [
9585
"rf70",
9686
] },
97-
{ value = "robotframework>=7.1, <7.2", if = [
87+
{ value = "robotframework~=7.1.0", if = [
9888
"rf71",
9989
] },
100-
{ value = "robotframework>=7.2, <7.3", if = [
90+
{ value = "robotframework~=7.2.0", if = [
10191
"rf72",
10292
] },
93+
{ value = "robotframework~=7.3.0", if = [
94+
"rf73",
95+
] },
10396
]
10497

10598
[envs.hatch-test]
10699
dependencies = ["pytest", "pytest-html", "pytest_asyncio>=0.23", "pyyaml"]
107100
pre-install-commands = ["python ./scripts/install_packages.py"]
108101

109102
[[envs.test.matrix]]
110-
rf = ["rf41", "rf50", "rf60", "rf61", "rf70", "rf71", "rf72"]
103+
rf = ["rf41", "rf50", "rf60", "rf61", "rf70", "rf71", "rf72", "rf73"]
111104

112105
[envs.test.overrides]
113106
matrix.rf.dependencies = [
114-
{ value = "robotframework>=4.1.0, <5.0", if = [
107+
{ value = "robotframework~=4.1.0", if = [
115108
"rf41",
116109
] },
117-
{ value = "robotframework>=5.0.0, <6.0", if = [
110+
{ value = "robotframework~=5.0.0", if = [
118111
"rf50",
119112
] },
120-
{ value = "robotframework>6.0.0, <6.1", if = [
113+
{ value = "robotframework~=6.0.0", if = [
121114
"rf60",
122115
] },
123-
{ value = "robotframework>=6.1, <7.0", if = [
116+
{ value = "robotframework~=6.1.0", if = [
124117
"rf61",
125118
] },
126-
{ value = "robotframework>=7.0, <7.1", if = [
119+
{ value = "robotframework~=7.0.0", if = [
127120
"rf70",
128121
] },
129-
{ value = "robotframework>=7.1, <7.2", if = [
122+
{ value = "robotframework~=7.1.0", if = [
130123
"rf71",
131124
] },
132-
{ value = "robotframework>=7.2, <7.3", if = [
125+
{ value = "robotframework~=7.2.0", if = [
133126
"rf72",
134127
] },
128+
{ value = "robotframework~=7.3.0", if = [
129+
"rf73",
130+
] },
135131
]
136132

137133
[envs.lint]
@@ -179,7 +175,7 @@ install-bundled-editable = "python ./scripts/install_bundled_editable.py"
179175

180176

181177
[envs.hatch-static-analysis]
182-
installer="uv"
178+
installer = "uv"
183179
dependencies = ["ruff"]
184180

185181
[envs.hatch-static-analysis.scripts]

packages/language_server/src/robotcode/language_server/robotframework/parts/semantic_tokens.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,9 @@ def generate_sem_sub_tokens(
471471
sem_mod.add(RobotSemTokenModifiers.BUILTIN)
472472

473473
if kw_doc is not None and kw_doc.is_embedded and kw_doc.matcher.embedded_arguments:
474-
if get_robot_version() >= (6, 0):
474+
if get_robot_version() >= (7, 3):
475+
m = kw_doc.matcher.embedded_arguments.name.fullmatch(kw)
476+
elif get_robot_version() >= (6, 0):
475477
m = kw_doc.matcher.embedded_arguments.match(kw)
476478
else:
477479
m = kw_doc.matcher.embedded_arguments.name.match(kw)

packages/robot/src/robotcode/robot/diagnostics/keyword_finder.py

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -306,17 +306,32 @@ def _is_worse_match_than_others(
306306
return True
307307
return False
308308

309-
def _is_better_match(
310-
self,
311-
candidate: Tuple[Optional[LibraryEntry], KeywordDoc],
312-
other: Tuple[Optional[LibraryEntry], KeywordDoc],
313-
) -> bool:
314-
return (
315-
other[1].matcher.embedded_arguments is not None
316-
and candidate[1].matcher.embedded_arguments is not None
317-
and other[1].matcher.embedded_arguments.match(candidate[1].name) is not None
318-
and candidate[1].matcher.embedded_arguments.match(other[1].name) is None
319-
)
309+
if get_robot_version() >= (7, 3):
310+
311+
def _is_better_match(
312+
self,
313+
candidate: Tuple[Optional[LibraryEntry], KeywordDoc],
314+
other: Tuple[Optional[LibraryEntry], KeywordDoc],
315+
) -> bool:
316+
return (
317+
other[1].matcher.embedded_arguments is not None
318+
and candidate[1].matcher.embedded_arguments is not None
319+
and other[1].matcher.embedded_arguments.matches(candidate[1].name)
320+
and not candidate[1].matcher.embedded_arguments.matches(other[1].name)
321+
)
322+
else:
323+
324+
def _is_better_match(
325+
self,
326+
candidate: Tuple[Optional[LibraryEntry], KeywordDoc],
327+
other: Tuple[Optional[LibraryEntry], KeywordDoc],
328+
) -> bool:
329+
return (
330+
other[1].matcher.embedded_arguments is not None
331+
and candidate[1].matcher.embedded_arguments is not None
332+
and other[1].matcher.embedded_arguments.match(candidate[1].name) is not None
333+
and candidate[1].matcher.embedded_arguments.match(other[1].name) is None
334+
)
320335

321336
@functools.cached_property
322337
def _resource_imports(self) -> List[ResourceEntry]:

packages/robot/src/robotcode/robot/diagnostics/library_doc.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def convert_from_rest(text: str) -> str:
199199

200200

201201
if get_robot_version() >= (6, 0):
202-
# monkey patch robot framework
202+
# monkey patch robot framework for performance reasons
203203
_old_from_name = EmbeddedArguments.from_name
204204

205205
@functools.lru_cache(maxsize=8192)
@@ -214,8 +214,14 @@ def _get_embedded_arguments(name: str) -> Any:
214214
except (VariableError, DataError):
215215
return ()
216216

217-
def _match_embedded(embedded_arguments: EmbeddedArguments, name: str) -> bool:
218-
return embedded_arguments.match(name) is not None
217+
if get_robot_version() >= (7, 3):
218+
219+
def _match_embedded(embedded_arguments: EmbeddedArguments, name: str) -> bool:
220+
return bool(embedded_arguments.matches(name))
221+
else:
222+
223+
def _match_embedded(embedded_arguments: EmbeddedArguments, name: str) -> bool:
224+
return embedded_arguments.match(name) is not None
219225

220226
else:
221227

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data: !GeneratedTestData
2+
character: 16
3+
line: 1
4+
name: built-in library
5+
result:
6+
- !CodeAction
7+
command:
8+
arguments:
9+
- <removed>
10+
command: robotcode.showDocumentation
11+
title: Open Documentation
12+
data: null
13+
diagnostics: null
14+
disabled: null
15+
edit: null
16+
is_preferred: null
17+
kind: source
18+
title: Open Documentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data: !GeneratedTestData
2+
character: 21
3+
line: 1
4+
name: built-in library
5+
result:
6+
- !CodeAction
7+
command:
8+
arguments:
9+
- <removed>
10+
command: robotcode.showDocumentation
11+
title: Open Documentation
12+
data: null
13+
diagnostics: null
14+
disabled: null
15+
edit: null
16+
is_preferred: null
17+
kind: source
18+
title: Open Documentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data: !GeneratedTestData
2+
character: 26
3+
line: 1
4+
name: built-in library
5+
result:
6+
- !CodeAction
7+
command:
8+
arguments:
9+
- <removed>
10+
command: robotcode.showDocumentation
11+
title: Open Documentation
12+
data: null
13+
diagnostics: null
14+
disabled: null
15+
edit: null
16+
is_preferred: null
17+
kind: source
18+
title: Open Documentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data: !GeneratedTestData
2+
character: 16
3+
line: 3
4+
name: user library
5+
result:
6+
- !CodeAction
7+
command:
8+
arguments:
9+
- <removed>
10+
command: robotcode.showDocumentation
11+
title: Open Documentation
12+
data: null
13+
diagnostics: null
14+
disabled: null
15+
edit: null
16+
is_preferred: null
17+
kind: source
18+
title: Open Documentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data: !GeneratedTestData
2+
character: 21
3+
line: 3
4+
name: user library
5+
result:
6+
- !CodeAction
7+
command:
8+
arguments:
9+
- <removed>
10+
command: robotcode.showDocumentation
11+
title: Open Documentation
12+
data: null
13+
diagnostics: null
14+
disabled: null
15+
edit: null
16+
is_preferred: null
17+
kind: source
18+
title: Open Documentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data: !GeneratedTestData
2+
character: 26
3+
line: 3
4+
name: user library
5+
result:
6+
- !CodeAction
7+
command:
8+
arguments:
9+
- <removed>
10+
command: robotcode.showDocumentation
11+
title: Open Documentation
12+
data: null
13+
diagnostics: null
14+
disabled: null
15+
edit: null
16+
is_preferred: null
17+
kind: source
18+
title: Open Documentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data: !GeneratedTestData
2+
character: 16
3+
line: 5
4+
name: user library by path with variable
5+
result:
6+
- !CodeAction
7+
command:
8+
arguments:
9+
- <removed>
10+
command: robotcode.showDocumentation
11+
title: Open Documentation
12+
data: null
13+
diagnostics: null
14+
disabled: null
15+
edit: null
16+
is_preferred: null
17+
kind: source
18+
title: Open Documentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data: !GeneratedTestData
2+
character: 31
3+
line: 5
4+
name: user library by path with variable
5+
result:
6+
- !CodeAction
7+
command:
8+
arguments:
9+
- <removed>
10+
command: robotcode.showDocumentation
11+
title: Open Documentation
12+
data: null
13+
diagnostics: null
14+
disabled: null
15+
edit: null
16+
is_preferred: null
17+
kind: source
18+
title: Open Documentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data: !GeneratedTestData
2+
character: 46
3+
line: 5
4+
name: user library by path with variable
5+
result:
6+
- !CodeAction
7+
command:
8+
arguments:
9+
- <removed>
10+
command: robotcode.showDocumentation
11+
title: Open Documentation
12+
data: null
13+
diagnostics: null
14+
disabled: null
15+
edit: null
16+
is_preferred: null
17+
kind: source
18+
title: Open Documentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
data: !GeneratedTestData
2+
character: 16
3+
line: 8
4+
name: resource
5+
result:
6+
- !CodeAction
7+
command:
8+
arguments:
9+
- <removed>
10+
command: robotcode.showDocumentation
11+
title: Open Documentation
12+
data: null
13+
diagnostics: null
14+
disabled: null
15+
edit: null
16+
is_preferred: null
17+
kind: source
18+
title: Open Documentation

0 commit comments

Comments
 (0)