I recently started P5JS, and I use VSCode as an editor.
VSCode doesn't know P5JS, because it's a library I guess, and makes all the wrong autocompletes.
Is there a way to import the P5JS languagefiles into VSCode, because it's a real pain.
Thank you in advance for your help.
p5.js is a JavaScript library for creative coding, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! p5.js is free and open-source because we believe software, and the tools to learn it, should be accessible to everyone.
Here's how to do it: Simply disable your extensions one at a time, and check to see if it made a difference. If your performance issues are obvious (E.g. files take 2 sec to open) than this should be quite easy. Disable → test → enable → disable the next one → test → etc.
As far as Intellisense for P5.js in Visual Studio Code is concerned, there is currently no official build of p5.js typescript definition files, hence it cannot be done with npm install
. I have attached a link to a zip file (as stack overflow doesn't support file attachment):
https://www.filehosting.org/file/details/795689/p5.d.zip
After download, put them in your project directory somewhere and add a reference to them in your sketch.js file.
E.g:
< reference path="./p5.global-mode.d.ts" / >
After that you will be able to get autocomplete & docs:
I used a P5.js Extension on it and It seems to have done the trick you will need to download the live server extension in the description enter image description here
you will also need to create a folder and then need to type this into the command pallette
"create p5.js project"
then you select your folder and then you should see this
enter image description here
you then select sketch.js for JavaScript and you may also edit the html code if you would like
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With