question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autocomplete editor for `pipeline.yaml`

See original GitHub issue

Most 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):

image

To see it in action:

  1. Create a file with .py extension on JupyterLab
  2. Open the file
  3. Right click on the editor window and click “Create Console for Editor”
  4. 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:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
edublancascommented, Aug 2, 2022

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

1reaction
idomiccommented, Aug 2, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autocomplete for your pipeline.yml files - Buildkite
Video showing autocompletion of a Buildkite pipeline file. Any editor extension that supports RedHat YAML Language Server will automatically ...
Read more >
YAML pipeline editor guide - Azure - Microsoft Learn
The editor provides tools like Intellisense support and a task assistant to provide guidance while you edit a pipeline. The YAML pipeline ......
Read more >
Azure Pipelines autocomplete in PyCharm, IntelliJ, WebStorm ...
Inside PyCharm, IntelliJ, etc. open up your Azure Pipelines YAML file. At the bottom toolbar you'll see a notification 'No JSON Schema'. Click ......
Read more >
Boost your YAML with autocompletion and validation - Medium
Boost your YAML with autocompletion and validation ... an easy declerative way to define application, infrastructure, CI/CD pipeline.
Read more >
Pipeline Editor - GitLab Docs
The pipeline editor is the primary place to edit the GitLab CI/CD configuration in the .gitlab-ci.yml file in the root of your repository....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found