Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] Add completion configurer #328

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c937e9e
wip icon picker main area widget
bollwyvl Aug 28, 2020
2f687f7
merge upstream
bollwyvl Aug 28, 2020
5887eeb
linting
bollwyvl Aug 28, 2020
07062bb
get round-tripping icon theme working
bollwyvl Aug 29, 2020
df45ac5
re-home completion configurer, style
bollwyvl Aug 29, 2020
ab1f8e5
work on license url
bollwyvl Aug 29, 2020
ba2ddfc
flesh out rest of settings
bollwyvl Aug 30, 2020
6981307
wire up simple booleans
bollwyvl Aug 30, 2020
ddd314c
start branded icons
bollwyvl Aug 30, 2020
2db7d46
lazy load icons by theme
bollwyvl Aug 30, 2020
8341192
rename to settingseditor
bollwyvl Aug 30, 2020
91b35f6
rework some type aliases
bollwyvl Aug 30, 2020
4c984d7
remove duplicate ui-components with yarn solve
bollwyvl Aug 30, 2020
773f301
add treatment for suppressIn
bollwyvl Aug 30, 2020
e24392d
give up on the comparison table
bollwyvl Aug 30, 2020
96c35b7
clean up some copy
bollwyvl Aug 30, 2020
6ef20ca
Add link to SPDX list
bollwyvl Aug 30, 2020
49f1df5
fix spdx typo
bollwyvl Aug 30, 2020
265ccd6
Merge remote-tracking branch 'upstream/master' into add-completion-co…
bollwyvl Sep 1, 2020
a5296e9
some style tweaks, add refresh button, linting
bollwyvl Sep 1, 2020
fee7e84
rework color schemes, add modifications per license
bollwyvl Sep 1, 2020
7156739
rework style
bollwyvl Sep 1, 2020
199816d
Merge remote-tracking branch 'origin/add-completion-configurer' into …
bollwyvl Sep 1, 2020
34cc443
move default color schemes to core, palette work
bollwyvl Sep 1, 2020
051d355
register null theme
bollwyvl Sep 1, 2020
7149a21
Merge remote-tracking branch 'upstream/master' into add-completion-co…
bollwyvl Sep 4, 2020
677436a
python linter, i guess
bollwyvl Sep 4, 2020
7a7c85d
unwrap map in merge
bollwyvl Sep 4, 2020
5a7a81d
default to null theme (if available)
bollwyvl Sep 4, 2020
4953232
fix existing robot tests for theme stuff
bollwyvl Sep 4, 2020
12fe40d
add bs4 to attempt windows utf-8 reading
bollwyvl Sep 5, 2020
70efe7e
fix typo
bollwyvl Sep 8, 2020
e7fa8e4
linting
bollwyvl Sep 8, 2020
affb602
start reworking plugin settings file cleaning, etc.
bollwyvl Sep 8, 2020
5c6b31c
screenshot filename typo
bollwyvl Sep 8, 2020
3512061
rework menu item labels
bollwyvl Sep 8, 2020
aa7b014
Merge remote-tracking branch 'upstream/master' into add-completion-co…
bollwyvl Sep 8, 2020
636bbc3
reorganize atest keywords, libraries
bollwyvl Sep 8, 2020
74ca304
start theme/scheme robot test, add some more dom markers
bollwyvl Sep 8, 2020
f448535
wuks the command palette selector, some thoughts on parsing images
bollwyvl Sep 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ atest/output/
junit.xml
coverage/
.vscode/
_schema.d.ts
_*.d.ts
_build
.virtual_documents/
2 changes: 1 addition & 1 deletion atest/00_Smoke.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*** Settings ***
Suite Setup Set Screenshot Directory ${OUTPUT DIR}${/}screenshots${/}smoke
Resource Keywords.robot
Resource keywords/Common.robot

*** Test Cases ***
Lab Version
Expand Down
4 changes: 2 additions & 2 deletions atest/01_Editor.robot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots editor
Force Tags ui:editor
Resource Keywords.robot
Resource keywords/Common.robot
Resource Variables.robot

*** Test Cases ***
Expand Down Expand Up @@ -77,7 +77,7 @@ Editor Shows Features for Language
... ELSE IF "${f}" == "Rename" Editor Should Rename ${features["${f}"]}
END
Capture Page Screenshot 99-done.png
[Teardown] Clean Up After Working With File ${file}
[Teardown] Clean Up After Working With Files ${file}

Editor Should Show Diagnostics
[Arguments] ${diagnostic}
Expand Down
2 changes: 1 addition & 1 deletion atest/02_Settings.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots settings
Resource Keywords.robot
Resource keywords/Common.robot

*** Test Cases ***
Settings
Expand Down
4 changes: 2 additions & 2 deletions atest/03_Notebook.robot
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots notebook
Test Setup Try to Close All Tabs
Resource Keywords.robot
Resource keywords/Common.robot

*** Test Cases ***
Python
[Setup] Setup Notebook Python Python.ipynb
${diagnostic} = Set Variable W291 trailing whitespace (pycodestyle)
Wait Until Page Contains Element css:.cm-lsp-diagnostic[title="${diagnostic}"] timeout=35s
Capture Page Screenshot 01-python.png
[Teardown] Clean Up After Working With File Python.ipynb
[Teardown] Clean Up After Working With Files Python.ipynb

Foreign Extractors
${file} = Set Variable Foreign extractors.ipynb
Expand Down
24 changes: 12 additions & 12 deletions atest/04_Interface/DiagnosticsPanel.robot
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots diagnostics_panel
Resource ../Keywords.robot
Test Setup Set Up
Test Teardown Clean Up
Resource ../keywords/Common.robot
Test Setup Set Up Diagnostic Panel Test
Test Teardown Clean Up Diagnostic Panel Test

*** Variables ***
${EXPECTED_COUNT} 1
${DIAGNOSTIC} W291 trailing whitespace (pycodestyle)
${DIAGNOSTIC MESSAGE} trailing whitespace
${MENU COLUMNS} xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "columns")]
${MENU COLUMNS} ${JLAB XP MENU ITEM LABEL}\[contains(text(), "columns")]
${LAB MENU} css:.lm-Menu

*** Test Cases ***
Expand All @@ -25,7 +25,7 @@ Diagnostics Panel Works After Rename
Open Diagnostics Panel
Capture Page Screenshot 01-panel-rename.png
Wait Until Keyword Succeeds 10 x 1s Should Have Expected Rows Count ${EXPECTED_COUNT}
Clean Up After Working With File PanelRenamed.ipynb
Clean Up After Working With Files PanelRenamed.ipynb

Diagnostics Panel Can Be Restored
Close Diagnostics Panel
Expand Down Expand Up @@ -70,7 +70,7 @@ Diagnostic Message Can Be Copied
*** Keywords ***
Expand Menu Entry
[Arguments] ${label}
${entry} = Set Variable xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "${label}")]
${entry} = Set Variable ${JLAB XP MENU ITEM LABEL}\[contains(text(), "${label}")]
Wait Until Page Contains Element ${entry} timeout=10s
${menus before} = Get Element Count ${LAB MENU}
Mouse Over ${entry}
Expand All @@ -84,7 +84,7 @@ Menus Count Equal

Select Menu Entry
[Arguments] ${label}
${entry} Set Variable xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), '${label}')]
${entry} Set Variable ${JLAB XP MENU ITEM LABEL}\[contains(text(), '${label}')]
Wait Until Page Contains Element ${entry} timeout=10s
Mouse Over ${entry}
Click Element ${entry}
Expand All @@ -93,7 +93,7 @@ Select Menu Entry
Open Notebook And Panel
[Arguments] ${notebook}
Setup Notebook Python ${notebook}
Capture Page Screenshot 00-notebook-and-panel-openeing.png
Capture Page Screenshot 00-notebook-and-panel-opening.png
Wait Until Page Contains Element css:.cm-lsp-diagnostic[title*="${DIAGNOSTIC}"] timeout=20s
Open Diagnostics Panel
Capture Page Screenshot 00-notebook-and-panel-opened.png
Expand All @@ -103,11 +103,11 @@ Should Have Expected Rows Count
${count} = Count Diagnostics In Panel
Should Be True ${count} == ${expected_count}

Set Up
Set Up Diagnostic Panel Test
Gently Reset Workspace
Open Notebook And Panel Panel.ipynb

Clean Up
Clean Up After Working With File Panel.ipynb
Reset Plugin Settings plugin=diagnostics
Clean Up Diagnostic Panel Test
Clean Up After Working With Files Panel.ipynb
Reset Plugin Settings
Reset Application State
6 changes: 3 additions & 3 deletions atest/04_Interface/Statusbar.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots statusbar
Resource ../Keywords.robot
Resource ../keywords/Common.robot

*** Variables ***
${STATUSBAR} css:div.lsp-statusbar-item
Expand All @@ -17,7 +17,7 @@ Statusbar Popup Opens
Capture Page Screenshot 01-statusbar.png
Element Should Contain ${POPOVER} python
Element Should Contain ${POPOVER} initialized
[Teardown] Clean Up After Working With File Python.ipynb
[Teardown] Clean Up After Working With Files Python.ipynb

Status Changes Correctly Between Editors
Prepare File for Editing Python status example.py
Expand All @@ -29,7 +29,7 @@ Status Changes Correctly Between Editors
Wait Until Fully Initialized
Switch To Tab example.plain
Wait Until Element Contains ${STATUSBAR} Initialized (additional servers needed) timeout=60s
[Teardown] Clean Up After Working With File example.plain
[Teardown] Clean Up After Working With Files example.plain

*** Keywords ***
Switch To Tab
Expand Down
103 changes: 3 additions & 100 deletions atest/05_Features/Completion.robot
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots completion
Test Setup Setup Completion Test
Test Teardown Clean Up After Working With File Completion.ipynb
Test Teardown Clean Up Completion Test
Force Tags feature:completion
Resource ../Keywords.robot

*** Variables ***
${COMPLETER_BOX} css:.jp-Completer.jp-HoverBox
Resource ../keywords/Completion.robot

*** Test Cases ***
Works With Kernel Running
Expand Down Expand Up @@ -45,7 +42,6 @@ Works In File Editor
Capture Page Screenshot 01-editor-ready.png
Trigger Completer
Completer Should Suggest add
[Teardown] Clean Up After Working With File completion.py

Autocompletes If Only One Option
Enter Cell Editor 3 line=1
Expand Down Expand Up @@ -118,98 +114,5 @@ Triggers Completer On Dot
Enter Cell Editor 2 line=1
Press Keys None .
Wait Until Keyword Succeeds 10x 0.5s Cell Editor Should Equal 2 list.
Wait Until Page Contains Element ${COMPLETER_BOX} timeout=35s
Wait Until Page Contains Element ${CSS COMPLETER BOX} timeout=35s
Completer Should Suggest append

Material Theme Works
Configure JupyterLab Plugin {"theme": "material"} plugin id=${COMPLETION PLUGIN ID}
Capture Page Screenshot 01-configured.png
Enter Cell Editor 1 line=2
Trigger Completer
Capture Page Screenshot 02-completions-shown.png
# TabError is a builtin exception which is a class in Python,
# so we should get lsp:material-class-light icon:
Completer Should Suggest TabError
Completer Should Include Icon lsp:material-class-light

VSCode Theme Works
Configure JupyterLab Plugin {"theme": "vscode"} plugin id=${COMPLETION PLUGIN ID}
Capture Page Screenshot 01-configured.png
Enter Cell Editor 1 line=2
Trigger Completer
Capture Page Screenshot 02-completions-shown.png
Completer Should Suggest TabError
Completer Should Include Icon lsp:vscode-class-light

VSCode Dark Theme Works
${file} = Set Variable Completion.ipynb
Lab Command Use JupyterLab Dark Theme
Wait For Splash
Capture Page Screenshot 00-theme-changed.png
Configure JupyterLab Plugin {"theme": "vscode"} plugin id=${COMPLETION PLUGIN ID}
Capture Page Screenshot 01-configured.png
Open ${file} in ${MENU NOTEBOOK}
Enter Cell Editor 1 line=2
Wait Until Fully Initialized
Trigger Completer
Capture Page Screenshot 02-completions-shown.png
Completer Should Suggest TabError
Completer Should Include Icon lsp:vscode-class-dark
Lab Command Use JupyterLab Light Theme
Wait For Splash

Works Without A Theme
Configure JupyterLab Plugin {"theme": null} plugin id=${COMPLETION PLUGIN ID}
Capture Page Screenshot 01-configured.png
Enter Cell Editor 1 line=2
Trigger Completer
Capture Page Screenshot 02-completions-shown.png
Completer Should Suggest TabError
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram

Works With Incorrect Theme
Configure JupyterLab Plugin {"theme": "a-non-existing-theme"} plugin id=${COMPLETION PLUGIN ID}
Capture Page Screenshot 01-configured.png
Enter Cell Editor 1 line=2
Trigger Completer
Capture Page Screenshot 02-completions-shown.png
Completer Should Suggest TabError
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram

*** Keywords ***
Setup Completion Test
Setup Notebook Python Completion.ipynb

Get Cell Editor Content
[Arguments] ${cell_nr}
${content} Execute JavaScript return document.querySelector('.jp-Cell:nth-child(${cell_nr}) .CodeMirror').CodeMirror.getValue()
[Return] ${content}

Cell Editor Should Equal
[Arguments] ${cell} ${value}
${content} = Get Cell Editor Content ${cell}
Should Be Equal ${content} ${value}

Select Completer Suggestion
[Arguments] ${text}
${suggestion} = Set Variable css:.jp-Completer-item[data-value="${text}"]
Wait Until Element Is Visible ${suggestion} timeout=10s
Mouse Over ${suggestion}
Click Element ${suggestion} code

Completer Should Suggest
[Arguments] ${text}
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-item[data-value="${text}"] timeout=10s
Capture Page Screenshot ${text.replace(' ', '_')}.png

Completer Should Include Icon
[Arguments] ${icon}
Wait Until Page Contains Element ${COMPLETER_BOX} svg[data-icon="${icon}"]

Completer Should Not Suggest
[Arguments] ${text}
Wait Until Page Does Not Contain Element ${COMPLETER_BOX} .jp-Completer-item[data-value="${text}"]

Trigger Completer
Press Keys None TAB
Wait Until Page Contains Element ${COMPLETER_BOX} timeout=35s
4 changes: 2 additions & 2 deletions atest/05_Features/Signature.robot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots signature
Force Tags feature:signature
Resource ../Keywords.robot
Resource ../keywords/Common.robot

*** Variables ***
${SIGNATURE_BOX} css:.lsp-signature-help
Expand All @@ -15,4 +15,4 @@ Triggers Signature Help After A Keystroke
Capture Page Screenshot 02-signature-shown.png
Wait Until Keyword Succeeds 20x 0.5s Page Should Contain Element ${SIGNATURE_BOX}
Element Should Contain ${SIGNATURE_BOX} Important docstring of abc()
[Teardown] Clean Up After Working With File Signature.ipynb
[Teardown] Clean Up After Working With Files Signature.ipynb
4 changes: 2 additions & 2 deletions atest/05_Features/Syntax_highlighting.robot
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots syntax_highlighting
Test Setup Setup Highlighting Test
Test Teardown Clean Up After Working With File Syntax highlighting.ipynb
Test Teardown Clean Up After Working With Files Syntax highlighting.ipynb
Force Tags feature:syntax_highlighting
Resource ../Keywords.robot
Resource ../keywords/Common.robot

*** Test Cases ***
Syntax Highlighting Mode Stays Normal In Normal Cells
Expand Down
6 changes: 3 additions & 3 deletions atest/06_Style.robot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*** Settings ***
Suite Setup Setup Suite For Screenshots style
Force Tags ui:editor aspect:style
Resource Keywords.robot
Resource keywords/Common.robot
Resource Variables.robot
Library Collections

Expand Down Expand Up @@ -35,7 +35,7 @@ Screenshot Editor Themes with Lab Theme
FOR ${editor theme} IN @{THEME NAMES}
Capture Theme Screenshot ${editor theme}
END
[Teardown] Clean Up After Working With File ${file}
[Teardown] Clean Up After Working With Files ${file}

Capture Theme Screenshot
[Arguments] ${editor theme}
Expand All @@ -51,7 +51,7 @@ Click the second Accumulate in ${editor}
Change Editor Theme
[Arguments] ${editor theme}
Open Editor Theme Menu
${sel} = Set Variable xpath://div[contains(@class, 'lm-Menu-itemLabel')][contains(text(), "${editor theme}")]
${sel} = Set Variable ${JLAB XP MENU ITEM LABEL}\[contains(text(), "${editor theme}")]
Wait Until Page Contains Element ${sel}
Mouse Over ${sel}
Click Element ${sel}
Expand Down
Loading