Skip to content

Commit 77a3554

Browse files
committed
feat: accomidate for legacy processing.path conig option
addresses #20 - add processing.path option to config options - look for `processing.path` option when getting config
1 parent 15151ba commit 77a3554

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Note on Processing 4: I'm not sure how this extension will handle Processing 4.
2424
- [Snippets](#snippets)
2525
- [Documentation on Hover](#documentation-on-hover)
2626
- [Commands](#commands)
27+
- [Using task files](#using-task-files)
2728
- [Processing Python](#processing-python)
2829
- [Credits](#credits)
2930

@@ -95,6 +96,12 @@ Installing this extension will add the following commands to your command pallet
9596
- Use the pallet command "Processing: Search Processing Website" to quickly search whatever you want on the processing website.
9697
- By default uses Google for search. Can change to DuckDuckGo if preferred using the `processing.search` setting.
9798

99+
## Using Task Files
100+
101+
The [original extension](https://github.com/TobiahZ/processing-vscode) made use of a [tasks.json](https://github.com/TobiahZ/processing-vscode/blob/b98d44b095b303f7f66017c632b17e47fa00dfcd/ProcessingTasks.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.
102+
103+
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}"`.
104+
98105
## Processing Python
99106

100107
This extension attempts to make Processing with Python easier to use. Follow these steps:

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@
172172
"default": "processing-java",
173173
"description": "Path to Processing. Leave default if you've added processing to your path, otherwise enter the path to `processing-java` here. Example: `/usr/bin/processing-java` for Unix, or `C:\\Program Files\\processing-3.0.1\\processing-java` for Windows."
174174
},
175+
"processing.path": {
176+
"type": "string",
177+
"default": "processing-java",
178+
"description": "Legacy path to Processing. Use processing.processingPath instead. If processing.processingPath is available, it will be used",
179+
"deprecationMessage": "Legacy path to Processing. Use processing.processingPath instead. If processing.processingPath is available, it will be used"
180+
},
175181
"processing.docs": {
176182
"type": "string",
177183
"default": "auto",

src/config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
import vscode from "vscode"
88

99
const getProcessingCommand = (): string => {
10+
// Look for processing.processingPath, then processing.path, then default to processing-java
1011
const config = vscode.workspace
1112
.getConfiguration()
12-
.get<unknown>("processing.processingPath", "processing-java")
13+
.get<unknown>(
14+
"processing.processingPath",
15+
vscode.workspace.getConfiguration().get<unknown>("processing.path", "processing-java"),
16+
)
1317

1418
if (typeof config !== "string") {
1519
const msg = "Config option processing.processingPath must be of type string"

0 commit comments

Comments
 (0)