Closed ohrely closed 3 years ago
Some general comment, could you upgrade the example to use the latest cookiecutter template? You can achieve that thanks to
scripts/upgrade_extensions.py
@fcollonval When I run this script, it makes modifications to setup.py and package.json in several of the example extensions and adds RELEASE.md to every extension. Is this the correct behavior?
Is this the correct behavior?
Yes this is expected as new commits have been pushed to the template project recently. If you can ignore those in the other extensions, it will be appreciated (so this PR keeps focusing on the new example alone).
The two build_all tests are failing because one inserted code snippet is getting "corrected" by pre-commit linting, so it no longer matches the (more indented) source of the snippet. Is there a preferred way to address this?
I'm not sure what to make of the three failing build_extensions checks.
Thanks for pushing forward
To fix the linter error in the Readme, you should wrap the code snippets between special comments; e.g.
<!-- prettier-ignore-start -->
```ts // src/index.ts#L12-L14
activate: (app: JupyterFrontEnd) => {
console.log('the JupyterLab main application:', app);
},
`` `
<!-- prettier-ignore-end -->
Regarding the remaining error in the new example, you need to overwrite tsconfig.json, .eslintrc.js, .eslintignore and .gitignore with those in the hello-world example (this is to ensure homogenous config).
Hi @ohrely and @fcollonval, I rebased from master and added a basic test.
I'll update the extension to JupyterLab v3.1 too.
@hbcarlos thanks for pushing this one. Could you please add a more advanced ui test that open a notebook, trigger the completer and check the suggestions are the one expected?
@fcollonval I'm not sure where the CI test fail. Do you have any advice?
We are getting closer 🙃
The integration test needs to be more robust. Did you try to run it locally before running it in the ci?
Two ideas, the kernel may not be ready when you hit tab. So waiting for the idle state could be good. The other one is that I had some trouble with codemirror edition that I circumvent by using page.keyboard
- see settings example.
Thanks for the advice, @fcollonval! Yes, I tested locally before pushing to CI.
Btw, when running locally, If you don't run npx playwright install
first, the test fails because chromium is not installed.
Thanks @hbcarlos
I updated the test to trigger the custom completion and make it more robust. Plus I catched some missing package not listed in dependencies.
Thanks to you for all the help!!
Thank you both!
Adds a basic example for customizing notebook completer functionality.
Inadvertently addresses https://github.com/jupyterlab/extension-examples/issues/156 by disabling the notebooks plugin.