-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Intellisense for P5.js in Visual Studio Code #1339
Comments
Hey @sarkarstanmoy! I'm actually working on this right now and blogged about it here: http://processing.toolness.org/general/2016/03/16/typescript-to-the-rescue.html That post links to |
Er, that said, if you'd like to start using those Typescript definitions and let me know about any problems you run into with them, that would be really helpful. 😁 |
Hey @toolness Thanks for sharing p5 typescript file. I am using Visual Studio Code to run my p5 js script and it seems like intellisense is working fine after incorporating your d.ts file in my VS code solution. I will let you know if found any issues. Thanks |
:) |
Hi @sarkarstanmoy , |
currently there's no official build of the p5.js typescript definition files, so you can't put them in your project directory somewhere and add a reference to them in your sketch .js file, eg:
then you should get autocomplete & docs: |
@sarkarstanmoy this is pretty awesome! You guys rock!! |
@Spongman thanks for the definition files! I see the following error when using it in my Angular app.
|
yeah, looks like we need to remove the unnecessary duplicate doc comments in noise.js. |
@Spongman Thanks for your zip. I'm trying to use the generated p5.d.ts file included but I'm running into errors like
Do you have any advice to resolve these issues? |
i have updated the .zip above, try with that. |
can someone build a node module for it? Keep it in project again and again seems like a headache |
Is there any update on this? Is @Spongman's p5.d.zip still the way to go? |
You can download the typescript declarations through npm here https://www.npmjs.com/package/@types/p5 |
For people who are using the Currently intellisense is only working if I either:
I'm working on a project that has multiple sketches, so it would be nice to have access to the definitions globally. I've tried a bunch of |
@neefrehman I've had success by creating a {
"include": [
"*.js",
"libraries/*.js",
"node_modules/@types/p5/global.d.ts"
]
} |
While the last comment is perfect for getting the bulk of autocomplete to work correctly, what I haven't been able to figure out is how to get it working specifically for the sound library ( Any help here would be much appreciated, as I've gone around in circles for hours to no avail... Edit: Needless to say adding Edit2: Decided to code p5 under typescript for the additional type safety checks and managed to get autocomplete working for all of @types/p5 now. |
Hi ,
First of all I would like to say that P5 editor is great and easy to use. The only one thing I am missing in P5 editor is intellisense. So, I try to run P5 project using Visual Studio Code. In VS Code for intellisense we need type script file i.e. tsd file for the js file for which we need intellisense. Since I couldn't found any P5 tsd files it is not helping much. Can you please look into this issue?
The text was updated successfully, but these errors were encountered: