p5canvas
p5canvas copied to clipboard
have VS Code offer code completion tailored to p5js
currently, VS Code helpfully offers a ton of JS APIs that have nothing to do with p5canvas. That would be neat if it didn't auto-override stuff one actually typed all the time. I would love if we could tailor intellisense to p5 a little more.
Currently, in an empty document, these replacements happen for me:
rotate() -> DeviceRotationRate scale() -> SVGFEFuncAElement
and a few more.
I have not yet managed to put this into p5canvas, but I have a test repository, where the @types/p5
get offered:
https://github.com/ccoenen/test-p5js-jsdom-action
Key is this changeset, where global.d.ts
and jsconfig.json
are added:
https://github.com/ccoenen/test-p5js-jsdom-action/commit/770ffafd8bcabd0d3f98ab11f2b46eb3b06fba7b
Currently, those must live in the project. If they could be taken out to p5canvas, that would make initial setup much easier for students.
it should be noted that my workaround only works for anyone having nodejs installed on their systems.