File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
robotcode/language_server/robotframework/parts Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1460,15 +1460,20 @@ async def complete_with_name() -> Optional[List[CompletionItem]]:
1460
1460
if context is None or context .trigger_kind != CompletionTriggerKind .INVOKED :
1461
1461
return []
1462
1462
1463
- if import_node .name and not any (v for v in import_node .tokens if v .value == "WITH NAME" ):
1463
+ if get_robot_version () >= (5 , 1 ):
1464
+ namespace_marker = ["AS" , "WITH NAME" ]
1465
+ else :
1466
+ namespace_marker = ["WITH NAME" ]
1467
+
1468
+ if import_node .name and not any (v for v in import_node .tokens if v .value in namespace_marker ):
1464
1469
name_token = import_node .get_token (RobotToken .NAME )
1465
1470
if position >= range_from_token (name_token ).extend (end_character = 2 ).end :
1466
1471
return [
1467
1472
CompletionItem (
1468
- label = "WITH NAME" ,
1473
+ label = "AS" if get_robot_version () >= ( 5 , 1 ) else " WITH NAME" ,
1469
1474
kind = CompletionItemKind .KEYWORD ,
1470
1475
# detail=e.detail,
1471
- sort_text = "03_WITH NAME " ,
1476
+ sort_text = "03_NAMESPACE_MARKER " ,
1472
1477
insert_text_format = InsertTextFormat .PLAINTEXT ,
1473
1478
)
1474
1479
]
You can’t perform that action at this time.
0 commit comments