Skip to content

Commit c8dfd9e

Browse files
Merge pull request #6 from Luke-zhang-04/staging
Added - feat: add python run button Changed - fix(docs): trim documentation hover data - fix: don't show hover docs on single line comments
2 parents 383b014 + cb48fd3 commit c8dfd9e

24 files changed

+6071
-3388
lines changed

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
* text=auto eol=lf
33

44
# Don't diff or textually merge documentation data
5-
src/documentation-data.json binary
5+
data/documentation-data.yml binary
6+
7+
.eslintrc.js linguist-detectable=false
8+
rollup.config.js linguist-detectable=false

.github/workflows/CI.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@ jobs:
1919

2020
- name: build
2121
run: yarn tsc
22+
23+
- name: lint
24+
run: yarn lint
25+
26+
- name: check with prettier
27+
run: yarn prettier . --check

.prettierignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
src/documentation-data.json
1+
data/*
2+
src/*.yml
23
*/node_modules/
34
build
45
.serverless
56
.vscode
67
lib/
78
tsconfig*.json
89
legacy
10+
processing-vscode.js

.vscodeignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
.github
22
.vscode/**
3+
data/
34
src/**
45
.editorconfig
56
.gitignore
67
.prettierrc.yml
7-
fetchDocs.mjs
88
tsconfig.json
99
tslint.json
1010
**/*.map
1111
yarn.lock
1212
rollup.config.js
13-
node_modules
13+
node_modules/
14+
scripts/
1415
*.log
1516
legacy/
1617
media/

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.2.0] - 2021-05-21
9+
10+
### Added
11+
12+
- feat: add python run button
13+
14+
### Changed
15+
16+
- fix(docs): trim documentation hover data
17+
- fix: don't show hover docs on single line comments
18+
819
## [2.1.0] - 2021-05-02
920

1021
### Added

README.md

Lines changed: 67 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<img width="25%" src="./images/icon.png" alt="icon"/>
2+
13
# Processing for Visual Studio Code
24

35
[![.github/workflows/CI.yml](https://img.shields.io/github/workflow/status/Luke-zhang-04/processing-vscode/Node.js%20CI?label=CI&logo=github)](https://github.com/Luke-zhang-04/processing-vscode/actions)
@@ -6,83 +8,105 @@
68
[![Installs](https://vsmarketplacebadge.apphb.com/installs-short/Luke-zhang-04.processing-vscode.svg)](https://marketplace.visualstudio.com/items?itemName=Luke-zhang-04.processing-vscode)
79
[![Rating](https://vsmarketplacebadge.apphb.com/rating-star/Luke-zhang-04.processing-vscode.svg)](https://marketplace.visualstudio.com/items?itemName=Luke-zhang-04.processing-vscode)
810

9-
Jump to the [Feature List](#Feature-list)
11+
## Contents
1012

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)
1224

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
1426

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.
1628

1729
## What this extension isn't
1830

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
2034

2135
## Why the fork?
2236

2337
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.
2438

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)
3044

3145
See the [CHANGELOG](https://github.com/Luke-zhang-04/processing-vscode/blob/main/CHANGELOG.md) for all changes
3246

47+
## Screenshots
48+
3349
![Hover](https://raw.githubusercontent.com/Luke-zhang-04/processing-vscode/main/media/hover-1.png)
50+
51+
<details>
52+
<summary>More Screenshots</summary>
53+
3454
![Hover](https://raw.githubusercontent.com/Luke-zhang-04/processing-vscode/main/media/hover-2.png)
3555
![Error](https://raw.githubusercontent.com/Luke-zhang-04/processing-vscode/main/media/error.png)
3656

57+
</details>
58+
3759
## Feature list
3860

3961
### Syntax highlighting
4062

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).
4264

4365
### Snippets
4466

4567
Once the language has been set, you will see code snippets pop up automatically as you type!
4668

4769
### Documentation on hover
4870

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.
5072

5173
### Commands
5274

5375
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.
5476

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)
84107

85108
## Credits
86109

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

Comments
 (0)