This is a Visual Studio Code extension created by Tobiah Zarlez to add Processing language support.
This extension does not allow you to debug Java or Processing projects.
Possibly! Let us know, we'd love to hear your suggestions.
CTRL+SHIFT+P
for Windows/Linux or CMD+SHIFT+P
on Mac) enter the command “Install Extension”Open any .pde file, or choose "Processing" from the drop down menu in the bottom right corner.
Once the language has been set, you will see code snippets pop up automatically as you type!
Installing this extension will add the following commands to your command pallette (CTRL+SHIFT+P
, or opened by View -> Command Pallette
). These commands can be selected and run from there, to complete the corresponding tasks.
Adds a .vscode/tasks.json
file to your project folder, that has the contents of the ProcessingTasks.json
located in the root folder of this project.
When you run this task (Keyboard shortcut: Ctrl+Shift+B
), it will compile and run your project!
If you would like to see output from the compiler, comment out the line "showOutput": "never",
NOTE: Processing must be added to your path, or you must set the "processing.path" setting!
Follow these instructions to add Processing to your path, or these alternate instructions instead to modify the path setting.
See "Requirements" for full details.
This is a shortcut for running the .vscode/tasks.json
file. Same as pressing Ctrl+Shift+B
Note: Must have ran the "Create Processing Task File" command first, see above!
Opens this documentation.
By default uses processing.org's documentation. Can change to p5js's if preferred using the processing.docs
setting.
Use the pallet command "Processing: Open Documentation for Selection" to open the processing documentation for the current selection.
By default uses processing.org's documentation. Can change to p5js's if preferred using the processing.docs
setting.
Use the pallet command "Processing: Search Processing Website" to quickly search whatever you want on the processing website.
By default uses processing.org's documentation. Can change to p5js's if preferred using the processing.docs
setting.
By default uses Google for search. Can change to DuckDuckGo if preferred using the processing.search
setting.
Installing the extension will give you instant access to syntax highlighting and snippets.
However, in order to compile and run your processing project from Visual Studio Code, you will need to do three things:
.vscode/tasks.json
file. (See: "Command: Create Task File").vscode/tasks.json
file. (See: "Add Processing to path" or "alternate method")<File>.pde
whose filename matches the name of the project's folder (General Processing Requirement). Your file cannot contain any spaces or it will not run correctly.In order to automatically compile and open from Visual Studio Code, I recommend adding Processing to your path.
That means you should be able to type the processing
from anywhere on your machine, and it will open Processing.
It's easier than you might think!
;C:\Program Files\Processing-3.0.1\
) to the variable value. Each entry is separated with a semicolon.Open Processing, and click the Tools
-> Install "processing-java"
menu item.
Note: You will have to install processing-java for all users for this to work
Set your PATH
to where your processing application is located.
Example: export PATH=$PATH:/opt/processing/processing-2.0b4
You also need to create an alias for processing-java
in /bin/
instead of /usr/bin/
.
Example: sudo ln -s /opt/processing/processing-java /bin/processing-java
Once you've installed Processing to your path, you need to add the appropriate .vscode/tasks.json
file to every Processing project.
See the command "Create Task File"
What if you cannot, or do not want to add Processing to your path?
You can modify the processing.path
setting to follow the path to wherever processing is installed on your machine. Be sure to remember to keep the processing-java
at the end of the path!
To change settings in VSCode, here is a link to the official documentation.
(Remember, for Windows be sure to turn any "\
" into "\\
"!)
Example:
"processing.path": "C:\\Program Files\\processing-3.0.1\\processing-java",
NOTE: This is untested on Mac and Linux
You may need to also overwrite your default terminal in order to get your task file to run correctly.
Following the instructions on the official VSCode documentation, all you have to do is add a few extra lines to your task file once you generate it.
For example, if you are running Windows and want the task file to use Command Prompt ('cmd.exe') you can add an 'options' parameter under the 'windows' portion:
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"args": [
"--force",
{
"value": "--sketch=${workspaceRoot}",
"quoting": "strong"
},
{
"value": "--output=${workspaceRoot}\\out",
"quoting": "strong"
},
"--run"
]
}
Syntax highlighting and snippets code based on the Processing Sublime Text plugin.
Here are some other resources I recommend: