Autocomplete editor for `pipeline.yaml`
See original GitHub issueMost of our users interact with Ploomber via a pipeline.yaml
; which has a pre-defined schema. However, this isn’t friendly for beginners who don’t know the allowed values. The idea is to build a Jupyter plug-in that adds autocomplete. Note that this is a big feature, so let’s go step by step and figure out things along the way.
We want to build this as a JupyterLab extension. Here’s the documentation to build extensions, here’s a tutorial that shows how to build a simple extension, and here’s a list of examples.
Based on this, it looks like JupyterLab provides re-usable components:
Some of the higher level components that can be used are text editors, terminals, notebooks, interactive widgets, filebrowser, renderers for different file formats that provide access to an enormous ecosystem of libraries from different languages.
so the first thing to figure out is how to re-use the existing text editor and add the autocomplete feature. Essentially, we want something like this but inside the text editor (not the notebook interface).
Note that a similar feature is already built-in (you we might want to look at JupyerLab’s source code to get some inspiration):
To see it in action:
- Create a file with .py extension on JupyterLab
- Open the file
- Right click on the editor window and click “Create Console for Editor”
- Then add some Python code (e.g. “import”) and hit tab
We essentially want the same thing except for files named pipeline.yaml
and without the requirement to click on “create a console for editor”.
Some tasks to get started:
- figure out how to add a custom text editor that re-uses the one that JupyterLab provides
- add an autocomplete feature (show the tooltip when pressing the tab key) with some dummy values
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
I think we should mimic the standard behavior of the existing autocompletion. In jupyter, it’s triggered with the tab key.
I agree with Ido, please push your changes so we can play around with it
Maybe having a way to play with it might be easier to see the UX? like if we deploy it on some jupyterlab instance. I think the shortcut is great, we should definitely have some button to launch this.