toolness / p5.js-widget

A reusable widget for embedding editable p5 sketches in web pages.
https://toolness.github.io/p5.js-widget/
GNU Lesser General Public License v2.1
162 stars 44 forks source link

Add auto-complete to the P5 widget #81

Open citelao opened 2 years ago

citelao commented 2 years ago

This (super preliminary) draft change adds IntelliSense/autocomplete to the editor!

To best handle this change, I switched the editor from CodeMirror to Monaco (the base of VS Code), since Monaco handles autocomplete much better (and by default!). This required a lot of other changes---updating the Webpack versions significantly, etc.

There's a ton of work left--- the editor is mis-sized (fixed!) and does not support undo/redo yet (supports undo now!). See the TODOs!

But wow, it's so cool!

Example

You can mess with it at https://ben.stolovitz.com/p5.js-widget/!

Auto-complete for 'circle'
Previous screenshots Before style changes: Auto-complete for 'background'

Notes

TODO