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 31 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/
21 changes: 13 additions & 8 deletions atest/05_Features/Completion.robot
Original file line number Diff line number Diff line change
Expand Up @@ -128,35 +128,38 @@ Material Theme Works
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:
# so we should get lsp:material-themed-class icon:
Completer Should Suggest TabError
Completer Should Include Icon lsp:material-class-light
Completer Should Include Icon lsp:material-themed-class
[Teardown] Reset Plugin Settings plugin id=${COMPLETION PLUGIN ID}

VSCode Theme Works
Configure JupyterLab Plugin {"theme": "vscode"} plugin id=${COMPLETION PLUGIN ID}
VSCode Unthemed Works
Configure JupyterLab Plugin {"theme": "vscode", "colorScheme": "unthemed"} 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
Completer Should Include Icon lsp:vscode-unthemed-class
[Teardown] Reset Plugin Settings plugin id=${COMPLETION PLUGIN ID}

VSCode Dark Theme Works
VSCode Muted 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}
Configure JupyterLab Plugin {"theme": "vscode", "colorScheme": "muted"} 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
Completer Should Include Icon lsp:vscode-muted-class
Lab Command Use JupyterLab Light Theme
Wait For Splash
[Teardown] Reset Plugin Settings plugin id=${COMPLETION PLUGIN ID}

Works Without A Theme
Configure JupyterLab Plugin {"theme": null} plugin id=${COMPLETION PLUGIN ID}
Expand All @@ -166,6 +169,7 @@ Works Without A Theme
Capture Page Screenshot 02-completions-shown.png
Completer Should Suggest TabError
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram
[Teardown] Reset Plugin Settings plugin id=${COMPLETION PLUGIN ID}

Works With Incorrect Theme
Configure JupyterLab Plugin {"theme": "a-non-existing-theme"} plugin id=${COMPLETION PLUGIN ID}
Expand All @@ -175,6 +179,7 @@ Works With Incorrect Theme
Capture Page Screenshot 02-completions-shown.png
Completer Should Suggest TabError
Wait Until Page Contains Element ${COMPLETER_BOX} .jp-Completer-monogram
[Teardown] Reset Plugin Settings plugin id=${COMPLETION PLUGIN ID}

*** Keywords ***
Setup Completion Test
Expand Down
11 changes: 5 additions & 6 deletions atest/Keywords.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Library SeleniumLibrary
Library OperatingSystem
Library Process
Library String
Library ./logcheck.py
Library ./ports.py

*** Keywords ***
Expand Down Expand Up @@ -70,12 +71,10 @@ Tear Down Everything
Terminate All Processes kill=${True}

Lab Log Should Not Contain Known Error Messages
${log} = Get File ${LAB LOG}
${test log} = Set Variable ${log[${PREVIOUS LAB LOG LENGTH}:]}
${length} = Get Length ${log}
Set Global Variable ${PREVIOUS LAB LOG LENGTH} ${length}
Run Keyword If ("${OS}", "${PY}") !\= ("Windows", "36")
... Should Not Contain Any ${test log} @{KNOWN BAD ERRORS}
Touch ${LAB LOG}
${length} = Get File Size ${LAB LOG}
File Should Not Contain Phrases ${LAB LOG} ${PREVIOUS LAB LOG LENGTH} @{KNOWN BAD ERRORS}
[Teardown] Set Global Variable ${PREVIOUS LAB LOG LENGTH} ${length}

Wait For Splash
Go To ${URL}lab?reset&token=${TOKEN}
Expand Down
24 changes: 24 additions & 0 deletions atest/logcheck.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os

from bs4 import UnicodeDammit


def file_should_not_contain_phrases(filename, offset=0, *phrases):
"""don't fail _too_ hard if the file can't be read for soem reason"""
krassowski marked this conversation as resolved.
Show resolved Hide resolved
with open(filename, "rb") as fp:
raw = fp.read()[offset:]

text = None

try:
text = raw.decode("utf-8")
except Exception as err:
text = UnicodeDammit.detwingle(raw).decode("utf-8")

matches = {}

for phrase in phrases:
if phrase in text:
matches[phrase] = True

assert not matches, "Phrases found in {}: {}".format(filename, matches)
4 changes: 2 additions & 2 deletions atest/ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@


def get_unused_port():
""" Get an unused port by trying to listen to any random port.
"""Get an unused port by trying to listen to any random port.

Probably could introduce race conditions if inside a tight loop.
Probably could introduce race conditions if inside a tight loop.
"""
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(("localhost", 0))
Expand Down
3 changes: 2 additions & 1 deletion ci/env-test.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ dependencies:
- pytest-runner
- ruamel_yaml
# browser testing
- bs4
- firefox
- geckodriver
- robotframework-seleniumlibrary
- robotframework >=3.2
- robotframework-seleniumlibrary
1 change: 1 addition & 0 deletions docs/Language Servers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"\n",
"import IPython\n",
"from jinja2 import Template\n",
"\n",
"from jupyter_lsp import LanguageServerManager"
]
},
Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@


def setup(app):
""" Runs before the "normal business" of sphinx. Don't go too crazy here.
"""
"""Runs before the "normal business" of sphinx. Don't go too crazy here."""
app.add_css_file("css/custom.css")
subprocess.check_call(["jlpm", "--ignore-optional"])
7 changes: 4 additions & 3 deletions packages/completion-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
"lab:link": "jupyter labextension link . --no-build"
},
"devDependencies": {
"react": "*",
"@jupyterlab/ui-components": "~2.2.0"
"react": "*"
},
"peerDependencies": {
"react": "*"
},
"peerDependencies": {},
"jupyterlab": {
"extension": true,
"schemaDir": "schema"
Expand Down
71 changes: 0 additions & 71 deletions packages/completion-theme/src/about.tsx

This file was deleted.

Loading