Skip to content

Commit ef0b51f

Browse files
committed
fix: correct analysing keywords with embedded arguments for RF >= 6.1
1 parent 99aa82d commit ef0b51f

File tree

2 files changed

+16
-2
lines changed
  • packages/language_server/robotcode/language_server/robotframework/diagnostics
  • tests/robotcode/language_server/robotframework/parts/data/tests/versions/rf61

2 files changed

+16
-2
lines changed

packages/language_server/robotcode/language_server/robotframework/diagnostics/analyzer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,10 @@ async def visit_Keyword(self, node: ast.AST) -> None: # noqa: N802
798798
if kw_doc is not None and kw_doc not in self._keyword_references:
799799
self._keyword_references[kw_doc] = set()
800800

801-
if is_embedded_keyword(keyword.name) and any(
802-
isinstance(v, Arguments) and len(v.values) > 0 for v in keyword.body
801+
if (
802+
get_robot_version() < (6, 1)
803+
and is_embedded_keyword(keyword.name)
804+
and any(isinstance(v, Arguments) and len(v.values) > 0 for v in keyword.body)
803805
):
804806
self.append_diagnostics(
805807
range=range_from_node_or_token(keyword, name_token),
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*** Test Cases ***
2+
Test 1
3+
do something with thing
4+
do something with thing and this data data1
5+
6+
*** Keywords ***
7+
do ${something} with ${thing}
8+
Log done ${something} with ${thing}
9+
10+
do ${something} with ${thing} and this data
11+
[Arguments] ${data}
12+
Log done ${something} with ${thing} and this data ${data}

0 commit comments

Comments
 (0)