Skip to content

Commit 5fc3104

Browse files
committed
fix(langserver): complete keywords containing . if there is no namespace with the name before the dot
1 parent 3d8a22d commit 5fc3104

File tree

1 file changed

+6
-3
lines changed
  • packages/language_server/src/robotcode/language_server/robotframework/parts

1 file changed

+6
-3
lines changed

Diff for: packages/language_server/src/robotcode/language_server/robotframework/parts/completion.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,10 @@ def enumerate_indexes(s: str, c: str) -> Iterator[int]:
745745
library_name = next(
746746
(e for e in libraries.keys() if library_name_matcher == KeywordMatcher(e)), library_name
747747
)
748-
748+
valid_namespace = False
749749
if library_name in libraries:
750+
valid_namespace = True
751+
750752
r.start.character = lib_name_index + 1
751753
for kw in libraries[library_name].library_doc.keywords.values():
752754
if kw.is_error_handler:
@@ -787,6 +789,7 @@ def enumerate_indexes(s: str, c: str) -> Iterator[int]:
787789
}
788790

789791
if resources:
792+
valid_namespace = True
790793
r.start.character = lib_name_index + 1
791794
for res in resources.values():
792795
for kw in res.library_doc.keywords.values():
@@ -819,8 +822,8 @@ def enumerate_indexes(s: str, c: str) -> Iterator[int]:
819822
),
820823
)
821824
)
822-
823-
return result
825+
if result and valid_namespace:
826+
return result
824827

825828
if r is None:
826829
r = Range(position, position)

0 commit comments

Comments
 (0)