Skip to content

Commit 28b0c71

Browse files
committed
Fix a test failing on CI as R got more methods starting with data.frame.p
1 parent 8565b00 commit 28b0c71

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

atest/05_Features/Completion.robot

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Completes Correctly With R Double And Triple Colon
267267
Completer Should Suggest .print.via.format
268268
Select Completer Suggestion .print.via.format
269269
Wait Until Keyword Succeeds 40x 0.5s File Editor Line Should Equal 1 tools::.print.via.format
270-
# tripple colon
270+
# triple colon
271271
Place Cursor In File Editor At 4 11
272272
Trigger Completer
273273
Completer Should Suggest .packageName
@@ -289,6 +289,8 @@ Shows Documentation With CompletionItem Resolve
289289
Wait Until Fully Initialized
290290
Trigger Completer
291291
Completer Should Suggest print.data.frame
292+
# if data.frame is not active, activate it (it should be in top 10 on any platform)
293+
Activate Completer Suggestion print.data.frame max_steps_down=10
292294
Completer Should Include Documentation Print a data frame.
293295
# should remain visible after typing:
294296
Press Keys None efa
@@ -342,6 +344,21 @@ File Editor Line Should Equal
342344
${line} = Get Line ${content} ${line}
343345
Should Be Equal ${line} ${value}
344346

347+
Activate Completer Suggestion
348+
[Arguments] ${text} ${max_steps_down}=100
349+
${suggestion} = Set Variable css:.jp-Completer-item[data-value="${text}"]
350+
Wait Until Page Contains Element ${suggestion}
351+
${active_suggestion} = Set Variable css:.jp-mod-active.jp-Completer-item[data-value="${text}"]
352+
FOR ${i} IN RANGE ${max_steps_down}
353+
Capture Page Screenshot ${i}-completions.png
354+
${matching_active_elements} = Get Element Count ${active_suggestion}
355+
LOG ${matching_active_elements}
356+
Exit For Loop If ${matching_active_elements} == 1
357+
Press Keys None DOWN
358+
Sleep 0.1s
359+
END
360+
Wait Until Page Contains Element ${active_suggestion}
361+
345362
Select Completer Suggestion
346363
[Arguments] ${text}
347364
${suggestion} = Set Variable css:.jp-Completer-item[data-value="${text}"]

python_packages/jupyter_lsp/jupyter_lsp/virtual_documents_shadow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ def read_lines(self):
4141
lines = [""]
4242
try:
4343
# TODO: what to do about bad encoding reads?
44-
lines = self.path.read_text(encoding='utf-8').splitlines()
44+
lines = self.path.read_text(encoding="utf-8").splitlines()
4545
except FileNotFoundError:
4646
pass
4747
return lines
4848

4949
@run_on_executor
5050
def write_lines(self):
5151
self.path.parent.mkdir(parents=True, exist_ok=True)
52-
self.path.write_text("\n".join(self.lines), encoding='utf-8')
52+
self.path.write_text("\n".join(self.lines), encoding="utf-8")
5353

5454
@staticmethod
5555
def trim(lines: list, character: int, side: int):

0 commit comments

Comments
 (0)