We are about to switch to a new forum software. Until then we have removed the registration on this forum.
How to use Visual Studio code with processing and p5:
1. Install VScode.
2. Install the vscode extension: processing-vscode.
3. Use following tasks.json file (put it inside .vscode folder of your project):
tasks
(change the parameters inside the file to point at your processing and p5 folders)
4. Add the following keyboard shortcut:
{ "key": "ctrl+F12", "command": "workbench.action.tasks.runTask" }
Now you can press:
Ctrl+Shift+B --> Run processing sketch
Ctrl+F12 --> Run processing sketch OR Open processing reference OR Run p5 script OR Open p5 reference
Happy coding :)
Comments
Thanks for the tip, @cameyo.
In case the linked file goes away, here is the above
tasks.json
file in its entirety:Note that this configuration is for Visual Studio for Windows (not Visual Studio for Mac).
Just to add, you need to click open folder instead of open file to set the proper "workspace" folder right in Visual Studio Code. Where do you add point 4. that you mention above @cameyo?
Kf
@kfrajer: yes, you must use "Open Folder" to set the proper workspace.
Add shortcut of point 4 with the VScode menu: File-> Preferences-> Keyboard Shortcuts
@jeremydouglass: for mac you must do little changes ("command" and "args") or write a condition to check the OS (see monkeyhacks.com/post/multiple-commands-with-visual-studio-code.
@cameyo
Thank you for clarifying. Having the option to run task or to build using the shortcut improves the whole experience using VS Code. I like to add that the build files are no longer stored in the temporal folder but inside the sketch folder in a new folder called out. Some people might like that. It also has the option to split the which while coding which is convenient. The only con so far is the need to copy the .vscode to every single project.
Kf
How to configure the json file, i do not have any experience, please help
@milex: The only configuration of json file are the paths... they must point to your processing and p5 installation.
Now you must put the json file within
.vscode
folder inside your project folder.Add shortcut of point 4 with the VScode menu:
File-> Preferences-> Keyboard Shortcuts
.From VS code select
File --> Open folder
and select your project folder.That's all :)
Really awesome and I think we could implement the highlight logic in Microsoft/language-server-protocol to support more editors with same code base :)
This is pretty awesome! I've highlighted the step by step process below under which I have been able to get it to work successfully for Processing.
The intellisense works well. I haven't been able to figure out how to set breakpoints and run a debugger just yet.
There is no support for breakpoints. I hope I have time somewhere next year to look into that. It shouldn't be that hard. In the processing IDE code you can already check how the offset is calculated (cause line numbers in processing don't correspond to the line numbers of the things that runs due to the precompiler of processing).
Is auto-format working? mine is not... =(
Plugin update at https://github.com/TobiahZ/processing-vscode
Author:Tobiah Zarlez
Now you can open processing help from VS Code.
<:-P