p5canvas icon indicating copy to clipboard operation
p5canvas copied to clipboard

have VS Code offer code completion tailored to p5js

Open ccoenen opened this issue 4 years ago • 2 comments

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.

ccoenen avatar Dec 18 '20 09:12 ccoenen

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.

ccoenen avatar Oct 20 '21 22:10 ccoenen

it should be noted that my workaround only works for anyone having nodejs installed on their systems.

ccoenen avatar Mar 19 '22 09:03 ccoenen