Skip to content

Commit 96f3293

Browse files
committed
correct casefold in completion of namespaces
1 parent cdba21f commit 96f3293

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

robotcode/language_server/robotframework/parts/completion.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ def enumerate_indexes(s: str, c: str) -> Iterator[int]:
371371
library_name = token.value[0 : lib_name_index - r.start.character] # noqa: E203
372372

373373
libraries = await namespace.get_libraries()
374+
375+
library_name = next((e for e in libraries.keys() if e.casefold() == library_name.casefold()), library_name)
376+
374377
if library_name in libraries:
375378
r.start.character = lib_name_index + 1
376379
for kw in libraries[library_name].library_doc.keywords.values():

robotcode/language_server/robotframework/parts/semantic_tokens.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ def generate_sem_sub_tokens(
221221
col_offset + old_index,
222222
index - old_index,
223223
RobotSemTokenTypes.NAMESPACE,
224-
{SemanticTokenModifiers.DEFAULT_LIBRARY} if token.value[:index] == "BuiltIn" else None,
224+
{SemanticTokenModifiers.DEFAULT_LIBRARY}
225+
if token.value[:index].casefold() == "BuiltIn".casefold()
226+
else None,
225227
)
226228
yield SemTokenInfo(token.lineno, col_offset + index, 1, RobotSemTokenTypes.SEPARATOR)
227229

0 commit comments

Comments
 (0)