Skip to content

Commit 4415387

Browse files
committed
fix: correct handling of @ variable and & dictionary arguments in signature help and completion
1 parent 38698ed commit 4415387

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,8 +1932,7 @@ async def _complete_KeywordCall_or_Fixture( # noqa: N802
19321932
keyword_doc = keyword_doc_and_token[0]
19331933

19341934
if keyword_doc.is_any_run_keyword():
1935-
# TODO
1936-
pass
1935+
return None
19371936

19381937
return self._complete_keyword_arguments_at_position(keyword_doc, kw_node.tokens, token_at_position, position)
19391938

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,13 @@ def get_argument_info_at_position(
717717
if argument_token_index < len(tokens) and tokens[argument_token_index].type == RobotToken.ARGUMENT:
718718
argument_token = tokens[argument_token_index]
719719

720-
if argument_index < 0:
720+
if (
721+
argument_index < 0
722+
or argument_token is not None
723+
and argument_token.type == RobotToken.ARGUMENT
724+
and argument_token.value.startswith(("@{", "&{"))
725+
and argument_token.value.endswith("}")
726+
):
721727
return -1, kw_arguments, argument_token
722728

723729
if argument_token is not None and argument_token.type == RobotToken.ARGUMENT:
@@ -745,10 +751,13 @@ def get_argument_info_at_position(
745751
break
746752
arg_name_or_value, arg_value = split_from_equals(a.value)
747753
if arg_value is not None and any(
748-
(i for i, v in enumerate(kw_arguments) if v.name == arg_name_or_value)
754+
(k for k, v in enumerate(kw_arguments) if v.name == arg_name_or_value)
749755
):
750756
need_named = True
751757
break
758+
if arg_name_or_value.startswith(("@{", "&{")) and arg_name_or_value.endswith("}"):
759+
need_named = True
760+
break
752761

753762
a_index = next(
754763
(

0 commit comments

Comments
 (0)