@@ -683,7 +683,7 @@ async def complete_default(
683
683
only_stars = value is not None and "*" in value and all (v == "*" for v in value )
684
684
if (
685
685
r .start .character == 0
686
- and (position .is_in_range (r ) or position == r . end )
686
+ and (position .is_in_range (r ))
687
687
and (only_stars or value .startswith ("*" ) or position .character == 0 )
688
688
):
689
689
return await self .create_section_completion_items (r )
@@ -692,7 +692,7 @@ async def complete_default(
692
692
ws = whitespace_at_begin_of_token (statement_node .tokens [1 ])
693
693
if ws > 0 :
694
694
r1 .end .character = r1 .start .character + ws
695
- if position .is_in_range (r1 ) or position == r1 . end :
695
+ if position .is_in_range (r1 ):
696
696
r .end = r1 .end
697
697
return await self .create_section_completion_items (r )
698
698
@@ -782,7 +782,7 @@ async def complete_SettingSection( # noqa: N802
782
782
if len (statement_node .tokens ) > 0 :
783
783
token = cast (Token , statement_node .tokens [0 ])
784
784
r = range_from_token (token )
785
- if position .is_in_range (r ) or r . end == position :
785
+ if position .is_in_range (r ):
786
786
return await self .create_settings_completion_items (r )
787
787
788
788
return None
@@ -826,7 +826,7 @@ async def _complete_TestCase_or_Keyword( # noqa: N802
826
826
index += 1
827
827
in_assign = True
828
828
r = range_from_token (token )
829
- if position .is_in_range (r ) or r . end == position :
829
+ if position .is_in_range (r ):
830
830
break
831
831
832
832
if len (statement_node .tokens ) > index :
@@ -839,7 +839,7 @@ async def _complete_TestCase_or_Keyword( # noqa: N802
839
839
ws_b = whitespace_from_begin_of_token (token )
840
840
r .start .character += 2 if ws_b and ws_b [0 ] != "\t " else 1
841
841
842
- if position .is_in_range (r ) or r . end == position :
842
+ if position .is_in_range (r ):
843
843
return await create_items (
844
844
in_assign ,
845
845
in_template ,
@@ -865,7 +865,7 @@ async def _complete_TestCase_or_Keyword( # noqa: N802
865
865
token = self .strip_bdd_prefix (token )
866
866
867
867
r = range_from_token (token )
868
- if position .is_in_range (r ) or r . end == position :
868
+ if position .is_in_range (r ):
869
869
return await create_items (in_assign , in_template , r , token , position )
870
870
871
871
if len (statement_node .tokens ) > index + 1 :
@@ -875,7 +875,7 @@ async def _complete_TestCase_or_Keyword( # noqa: N802
875
875
return None
876
876
877
877
r .end .character += 1
878
- if position .is_in_range (r ) or r . end == position :
878
+ if position .is_in_range (r ):
879
879
return await create_items (
880
880
in_assign , in_template , r , None if self .is_bdd_token (token ) else token , position
881
881
)
@@ -987,7 +987,7 @@ async def _complete_SuiteSetup_or_SuiteTeardown_or_TestTemplate( # noqa: N802
987
987
ws_b = whitespace_from_begin_of_token (token )
988
988
r .start .character += 2 if ws_b and ws_b [0 ] != "\t " else 1
989
989
990
- if position .is_in_range (r ) or r . end == position :
990
+ if position .is_in_range (r ):
991
991
return await self .create_keyword_completion_items (
992
992
statement_node .tokens [2 ] if r .end == position and len (statement_node .tokens ) > 2 else None ,
993
993
position ,
@@ -1001,7 +1001,7 @@ async def _complete_SuiteSetup_or_SuiteTeardown_or_TestTemplate( # noqa: N802
1001
1001
token = self .strip_bdd_prefix (token )
1002
1002
1003
1003
r = range_from_token (token )
1004
- if position .is_in_range (r ) or r . end == position :
1004
+ if position .is_in_range (r ):
1005
1005
return await self .create_keyword_completion_items (
1006
1006
None if self .is_bdd_token (token ) else token ,
1007
1007
position ,
@@ -1016,7 +1016,7 @@ async def _complete_SuiteSetup_or_SuiteTeardown_or_TestTemplate( # noqa: N802
1016
1016
return None
1017
1017
1018
1018
r .end .character += 1
1019
- if position .is_in_range (r ) or r . end == position :
1019
+ if position .is_in_range (r ):
1020
1020
return await self .create_keyword_completion_items (
1021
1021
None if self .is_bdd_token (token ) else token ,
1022
1022
position ,
@@ -1115,7 +1115,7 @@ async def complete_Setup_or_Teardown_or_Template( # noqa: N802
1115
1115
ws_b = whitespace_from_begin_of_token (token )
1116
1116
r .start .character += 2 if ws_b and ws_b [0 ] != "\t " else 1
1117
1117
1118
- if position .is_in_range (r ) or r . end == position :
1118
+ if position .is_in_range (r ):
1119
1119
return await self .create_keyword_completion_items (
1120
1120
statement_node .tokens [3 ] if r .end == position and len (statement_node .tokens ) > 3 else None ,
1121
1121
position ,
@@ -1129,7 +1129,7 @@ async def complete_Setup_or_Teardown_or_Template( # noqa: N802
1129
1129
token = self .strip_bdd_prefix (token )
1130
1130
1131
1131
r = range_from_token (token )
1132
- if position .is_in_range (r ) or r . end == position :
1132
+ if position .is_in_range (r ):
1133
1133
return await self .create_keyword_completion_items (
1134
1134
token ,
1135
1135
position ,
@@ -1144,7 +1144,7 @@ async def complete_Setup_or_Teardown_or_Template( # noqa: N802
1144
1144
return None
1145
1145
1146
1146
r .end .character += 1
1147
- if position .is_in_range (r ) or r . end == position :
1147
+ if position .is_in_range (r ):
1148
1148
return await self .create_keyword_completion_items (
1149
1149
None if self .is_bdd_token (token ) else token ,
1150
1150
position ,
@@ -1210,18 +1210,18 @@ async def complete_import() -> Optional[List[CompletionItem]]:
1210
1210
1211
1211
if len (import_node .tokens ) > import_token_index + 2 :
1212
1212
name_token = import_node .tokens [import_token_index + 2 ]
1213
- if not position .is_in_range (r := range_from_token (name_token )) and r . end != position :
1213
+ if not position .is_in_range (r := range_from_token (name_token )):
1214
1214
return None
1215
1215
1216
1216
elif len (import_node .tokens ) > import_token_index + 1 :
1217
1217
name_token = import_node .tokens [import_token_index + 1 ]
1218
- if position .is_in_range (r := range_from_token (name_token )) or r . end == position :
1218
+ if position .is_in_range (r := range_from_token (name_token )):
1219
1219
if whitespace_at_begin_of_token (name_token ) > 1 :
1220
1220
1221
1221
ws_b = whitespace_from_begin_of_token (name_token )
1222
1222
r .start .character += 2 if ws_b and ws_b [0 ] != "\t " else 1
1223
1223
1224
- if not position .is_in_range (r ) and r . end != position :
1224
+ if not position .is_in_range (r ):
1225
1225
return None
1226
1226
else :
1227
1227
return None
@@ -1448,18 +1448,18 @@ async def complete_ResourceImport( # noqa: N802
1448
1448
1449
1449
if len (import_node .tokens ) > import_token_index + 2 :
1450
1450
name_token = import_node .tokens [import_token_index + 2 ]
1451
- if not position .is_in_range (r := range_from_token (name_token )) and r . end != position :
1451
+ if not position .is_in_range (r := range_from_token (name_token )):
1452
1452
return None
1453
1453
1454
1454
elif len (import_node .tokens ) > import_token_index + 1 :
1455
1455
name_token = import_node .tokens [import_token_index + 1 ]
1456
- if position .is_in_range (r := range_from_token (name_token )) or r . end == position :
1456
+ if position .is_in_range (r := range_from_token (name_token )):
1457
1457
if whitespace_at_begin_of_token (name_token ) > 1 :
1458
1458
1459
1459
ws_b = whitespace_from_begin_of_token (name_token )
1460
1460
r .start .character += 2 if ws_b and ws_b [0 ] != "\t " else 1
1461
1461
1462
- if not position .is_in_range (r ) and r . end != position :
1462
+ if not position .is_in_range (r ):
1463
1463
return None
1464
1464
else :
1465
1465
return None
@@ -1549,18 +1549,18 @@ async def complete_VariablesImport( # noqa: N802
1549
1549
1550
1550
if len (import_node .tokens ) > import_token_index + 2 :
1551
1551
name_token = import_node .tokens [import_token_index + 2 ]
1552
- if not position .is_in_range (r := range_from_token (name_token )) and r . end != position :
1552
+ if not position .is_in_range (r := range_from_token (name_token )):
1553
1553
return None
1554
1554
1555
1555
elif len (import_node .tokens ) > import_token_index + 1 :
1556
1556
name_token = import_node .tokens [import_token_index + 1 ]
1557
- if position .is_in_range (r := range_from_token (name_token )) or r . end == position :
1557
+ if position .is_in_range (r := range_from_token (name_token )):
1558
1558
if whitespace_at_begin_of_token (name_token ) > 1 :
1559
1559
1560
1560
ws_b = whitespace_from_begin_of_token (name_token )
1561
1561
r .start .character += 2 if ws_b and ws_b [0 ] != "\t " else 1
1562
1562
1563
- if not position .is_in_range (r ) and r . end != position :
1563
+ if not position .is_in_range (r ):
1564
1564
return None
1565
1565
else :
1566
1566
return None
0 commit comments