|
| 1 | +<img width="25%" src="./images/icon.png" alt="icon"/> |
| 2 | + |
1 | 3 | # Processing for Visual Studio Code |
2 | 4 |
|
3 | 5 | [](https://github.com/Luke-zhang-04/processing-vscode/actions) |
|
6 | 8 | [](https://marketplace.visualstudio.com/items?itemName=Luke-zhang-04.processing-vscode) |
7 | 9 | [](https://marketplace.visualstudio.com/items?itemName=Luke-zhang-04.processing-vscode) |
8 | 10 |
|
9 | | -Jump to the [Feature List](#Feature-list) |
| 11 | +## Contents |
10 | 12 |
|
11 | | -## What this extension is |
| 13 | +- [What this extension is](#what-this-extension-is) |
| 14 | +- [What this extension isn't](#what-this-extension-isnt) |
| 15 | +- [Why the fork?](#why-the-fork) |
| 16 | +- [Screenshots](#screenshots) |
| 17 | +- [Feature list](#feature-list) |
| 18 | + - [Syntax Highlighting](#syntax-highlighting) |
| 19 | + - [Snippets](#snippets) |
| 20 | + - [Documentation on Hover](#documentation-on-hover) |
| 21 | + - [Commands](#commands) |
| 22 | +- [Processing Python](#processing-python) |
| 23 | +- [Credits](#credits) |
12 | 24 |
|
13 | | -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. |
| 25 | +## What this extension is |
14 | 26 |
|
15 | | -Note: You should probably uninstall the old extension as the syntax highlighting will conflict |
| 27 | +This is a [fork of a Visual Studio Code extension created by Tobiah Zarlez](https://github.com/TobiahZ/processing-vscode) to add [Processing](https://processing.org/) language support, with added documentation on hover, diagnostics, and more. |
16 | 28 |
|
17 | 29 | ## What this extension isn't |
18 | 30 |
|
19 | | -This extension does not allow you to debug Java or Processing projects. It also doesn't include any sort of intellisense. |
| 31 | +- This extension does not allow you to debug Java or Processing projects. |
| 32 | +- 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 definetly out of the scope of my abilities. Langauge servers take entire teams from big companies such as Microsoft to make. |
| 33 | + - This extension cannot provide intellesence, for example |
20 | 34 |
|
21 | 35 | ## Why the fork? |
22 | 36 |
|
23 | 37 | The [original extension](https://github.com/TobiahZ/processing-vscode) 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. |
24 | 38 |
|
25 | | -- Better syntax highlighting (thanks to [Red Hat](https://github.com/redhat-developer/vscode-java/blob/master/syntaxes/java.tmLanguage.json)) |
26 | | -- Documentation on hover |
27 | | -- A run button |
28 | | -- Simple diagnostics |
29 | | -- Strings are auto closing and surrounding |
| 39 | +- Better syntax highlighting (from [Red Hat Java](https://github.com/redhat-developer/vscode-java/blob/master/syntaxes/java.tmLanguage.json)) |
| 40 | +- Documentation on hover (via Regex) |
| 41 | +- A run button (both Processing Java and Processing Python) |
| 42 | +- Simple diagnostics (via the processing-java CLI, which can be extremely slow, and is disabled by default) |
| 43 | +- Strings are auto closing and surrounding (didn't work in the old extension) |
30 | 44 |
|
31 | 45 | See the [CHANGELOG](https://github.com/Luke-zhang-04/processing-vscode/blob/main/CHANGELOG.md) for all changes |
32 | 46 |
|
| 47 | +## Screenshots |
| 48 | + |
33 | 49 |  |
| 50 | + |
| 51 | +<details> |
| 52 | +<summary>More Screenshots</summary> |
| 53 | + |
34 | 54 |  |
35 | 55 |  |
36 | 56 |
|
| 57 | +</details> |
| 58 | + |
37 | 59 | ## Feature list |
38 | 60 |
|
39 | 61 | ### Syntax highlighting |
40 | 62 |
|
41 | | -Open any .pde file, or choose "Processing" from the drop down menu in the bottom right corner. |
| 63 | +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](https://github.com/redhat-developer/vscode-java/blob/master/syntaxes/java.tmLanguage.json). |
42 | 64 |
|
43 | 65 | ### Snippets |
44 | 66 |
|
45 | 67 | Once the language has been set, you will see code snippets pop up automatically as you type! |
46 | 68 |
|
47 | 69 | ### Documentation on hover |
48 | 70 |
|
49 | | -When you hover over a function such as `square`, documentation for this function will appear! |
| 71 | +When you hover over a function such as `square`, documentation for this function will appear! Documentation is scraped directly from the [Processing reference page](https://processing.org/reference/), so anything missing from there will be missing here too. |
50 | 72 |
|
51 | 73 | ### Commands |
52 | 74 |
|
53 | 75 | 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. |
54 | 76 |
|
55 | | -## Command: Open Extension Documentation |
56 | | - |
57 | | -Opens this documentation. |
58 | | - |
59 | | -## Command: Open Documentation for Selection |
60 | | - |
61 | | -Use the pallet command "Processing: Open Documentation for Selection" to open the processing documentation for the current selection. |
62 | | - |
63 | | -By default uses processing.org's documentation. Can change to p5js's if preferred using the `processing.docs` setting. |
64 | | - |
65 | | -## Command: Run |
66 | | - |
67 | | -Runs the current processing project (from current working directory). Also includes a run button in the editor menu |
68 | | - |
69 | | -## Command: Search Processing Website |
70 | | - |
71 | | -Use the pallet command "Processing: Search Processing Website" to quickly search whatever you want on the processing website. |
72 | | - |
73 | | -By default uses Google for search. Can change to DuckDuckGo if preferred using the `processing.search` setting. |
74 | | - |
75 | | -## Proper Hover, Intellisense, and Diagnostics |
76 | | - |
77 | | -Problems with the current approach: |
78 | | - |
79 | | -- Hover works with word matching, so comments show documentation on hover |
80 | | -- There's no intellsense, only the built in VSCode word matching |
81 | | -- Diagnostics rely on processing-java, which makes it very slow, and also has no option to cache the build |
82 | | - |
83 | | -Despite all these problems however, this extension probably will stay this way. Why? Because there isn't nearly enough demand to make a "proper" extension that popular languages such as Python do. Making an extension like this would require me to write a parser and generate an AST, far too much work for a language that I won't really be using outside of my class, and way outside of my abilities. If someone really wants to do this, they can go ahead, I guess. |
| 77 | +- Open Extension Documentation |
| 78 | + - Opens this documentation. |
| 79 | +- Open Documentation for Selection |
| 80 | + - Use the pallet command "Processing: Open Documentation for Selection" to open the processing documentation for the current selection. |
| 81 | + - By default uses processing.org's documentation. Can change to p5js's if preferred using the `processing.docs` setting. |
| 82 | +- Run |
| 83 | + - Runs the current Processing project (from current working directory). Will automatically detect if the project is Processing Java or Python |
| 84 | +- RunJava |
| 85 | + - Runs the current Processing Java project (from CWD) |
| 86 | +- RunPy |
| 87 | + - Runs the current Processing Python project (from CWD) |
| 88 | +- Search Processing Website |
| 89 | + - Use the pallet command "Processing: Search Processing Website" to quickly search whatever you want on the processing website. |
| 90 | + - By default uses Google for search. Can change to DuckDuckGo if preferred using the `processing.search` setting. |
| 91 | + |
| 92 | +## Processing Python |
| 93 | + |
| 94 | +This extension attempts to make Processing with Python easier to use. Follow these steps: |
| 95 | + |
| 96 | +1. Download the [processing-python library](https://py.processing.org/tutorials/command-line/#requirements) for your operating system |
| 97 | + - 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` |
| 98 | +2. Download the proper [Java version](https://py.processing.org/tutorials/command-line/#requirements) for your operating system |
| 99 | + - Follow the steps in the [Processing docs](https://py.processing.org/tutorials/command-line/#requirements) |
| 100 | +3. Configure the extension |
| 101 | + - Change the following configuration options |
| 102 | + - `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` |
| 103 | + - `processing.py.javaPath`: the path to your `java` executable. For example, `/usr/bin/java` |
| 104 | +4. Downloads stub definitions (optional) |
| 105 | + - Definitions can be found [here](https://github.com/Abdulla060/Processing.py-intellisense/blob/master/lib/Processing3.pyi) |
| 106 | + - After than, follow the imports in [this example](https://github.com/Abdulla060/Processing.py-intellisense/blob/master/Example.py) |
84 | 107 |
|
85 | 108 | ## Credits |
86 | 109 |
|
87 | | -Snippets are based on the [Processing Sublime Text plugin](https://github.com/b-g/processing-sublime). |
88 | | -Syntax highlighting is based on the [Red Hat VSCode-Java extension grammar](https://github.com/redhat-developer/vscode-java/blob/master/syntaxes/java.tmLanguage.json) |
| 110 | +- Snippets are based on the [Processing Sublime Text plugin](https://github.com/b-g/processing-sublime). |
| 111 | +- Syntax highlighting is based on the [Red Hat VSCode-Java extension grammar](https://github.com/redhat-developer/vscode-java/blob/master/syntaxes/java.tmLanguage.json) |
| 112 | +- Thanks to [Tobiah Zarlez](https://github.com/TobiahZ) for making the [original extension](https://github.com/TobiahZ/processing-vscode) |
0 commit comments