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

Add auto-complete to the P5 widget #81

Draft
wants to merge 48 commits into
base: master
Choose a base branch
from

Conversation

citelao
Copy link

@citelao citelao commented Dec 28, 2021

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

  • Complete porting syntax highlighting
  • Allow custom syntax highlighting themes
  • Allow custom d.ts files
  • Ensure default min-height is good
  • Fix logo
  • Remove CodeMirror code
  • Move dependencies to devDependencies
  • Add GH Pages site
  • Add full-screen test page
  • Fix padding around editor
  • Fix padding around line numbers
  • Allow % for preview width
  • [Nice to have] Allow resizing preview pane

"chai": "^3.5.0",
"webpack-dev-server": "^1.14.1"
"mocha-chrome": "^2.2.0",
"mocha-phantomjs": "^4.1.0",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove obsolete phantomjs

@@ -47,6 +62,14 @@ module.exports = configurations({
'preview-frame': './lib/preview-frame.ts',
'tests': './test/main.tsx'
},
devServer: {
// historyApiFallback: {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant