Processing for Visual Studio Code
Note on Processing 4: I'm not sure how this extension will handle Processing 4. I will wait for it to be out of beta and fix the extension if needed.
Contents
What this extension is
This is a fork of a Visual Studio Code extension created by Tobiah Zarlez to add Processing language support, with added documentation on hover, diagnostics, and more.
What this extension isn't
- This extension does not allow you to debug Java or Processing projects.
- This is NOT a language server, and hence cannot provide the features a language server can. There simply is not enough demand for a Processing language server, and that type of thing is definitely out of the scope of my abilities. Language servers take entire teams from big companies such as Microsoft to make.
- This extension cannot provide IntelliSense, for example
Why the fork?
The original extension was missing some features that I wanted and it seemed as if the repo was no longer being maintained. So, forked the extension and changed some things.
- Better syntax highlighting (from Red Hat Java)
- Documentation on hover (via Regex)
- A run button (both Processing Java and Processing Python)
- Simple diagnostics (via the processing-java CLI, which can be extremely slow, and is disabled by default)
- Strings are auto closing and surrounding (didn't work in the old extension)
See the CHANGELOG for all changes
Screenshots
More Screenshots
Feature list
Syntax highlighting
Open any .pde file, or choose "Processing" from the drop down menu in the bottom right corner. Syntax highlighting is from Red Hat's Java extension.
Snippets
Once the language has been set, you will see code snippets pop up automatically as you type!
Documentation on hover
When you hover over a function such as square
, documentation for this function will appear! Documentation is scraped directly from the Processing reference page, so anything missing from there will be missing here too.
Commands
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.
- Open Extension Documentation
- Opens this documentation.
- Open Documentation for Selection
- 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.
- Run
- Runs the current Processing project (from current working directory). Will automatically detect if the project is Processing Java or Python.
- If the setting
processing.shouldSendSigint
is set to true
, run will interrupt the current running processing program before running the new one.
- RunJava
- Runs the current Processing Java project (from CWD)
- RunPy
- Runs the current Processing Python project (from CWD)
- Search Processing Website
- Use the pallet command "Processing: Search Processing Website" to quickly search whatever you want on the processing website.
- By default uses Google for search. Can change to DuckDuckGo if preferred using the
processing.search
setting.
Using Task Files
The original extension made use of a tasks.json file to run processing projects. This has been replaced with the run command and run button (processing.Run). You can bind this command to a keybinding.
Alternatively, if you prefer the tasks.json
file, you can continue to use it, but the command
field should be changed to "${config:processing.path}"
.
Processing Python
This extension attempts to make Processing with Python easier to use. Follow these steps:
- Download the processing-python library for your operating system
- Take note of the location of this file. For example, I might store mine in
~/processing.py-linux64/processing.py-3056-linux64/processing-py.jar
- Download the proper Java version for your operating system
- Configure the extension
- Change the following configuration options
processing.py.jarPath
: the path to your processing-py.jar
file. Preferably, this is an absolute path. In this example, it will be ~/processing.py-linux64/processing.py-3056-linux64/processing-py.jar
processing.py.javaPath
: the path to your java
executable. For example, /usr/bin/java
- Make sure
processing.py.isEnabled
is set to true
(true by default)
- Downloads stub definitions (optional)
Credits
Development
- Run
yarn vsce package
- Run
code --install-extension processing-vscode-<VERSION>.vsix