Skip to content

Fixed Issue #978 #1015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 12, 2019
Merged

Fixed Issue #978 #1015

merged 2 commits into from
Apr 12, 2019

Conversation

AnkurIngale
Copy link
Contributor

@AnkurIngale AnkurIngale commented Apr 3, 2019

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • is from a uniquely-named feature branch and has been rebased on top of the latest master. (If I was asked to make more changes, I have made sure to rebase onto master then too)
  • Fixes Missing p5.js keyword/function highlights #978
    @catarak views?

@AnkurIngale
Copy link
Contributor Author

https://editor.p5js.org/Janglee123/sketches/z5DUgwwjy All keywords have highlighted now.

@catarak
Copy link
Member

catarak commented Apr 3, 2019

this definitely improves the issue. i've noticed that they keywords in p5.dom and p5.sound are not highlighted, and i'd like to add those too.

@AnkurIngale
Copy link
Contributor Author

@catarak Cool I'll add those as well. If you have a list, my work will get a bit easier.

@catarak
Copy link
Member

catarak commented Apr 3, 2019

I just opened processing/p5.js#3666 to address getting a list. I was trying to remember how I originally got the list of keywords, and I couldn't. The only thing I can think of is that I got it from the now deprecated p5.js desktop editor.

@AnkurIngale
Copy link
Contributor Author

@catarak
Copy link
Member

catarak commented Apr 4, 2019

i think the way to approach this is going to be to parse the data.json file that gets updated with every p5.js release

@AnkurIngale
Copy link
Contributor Author

The 'name' key? Like extract all values with key 'name' and store them as keywords?

@catarak
Copy link
Member

catarak commented Apr 5, 2019

you'll also need to check itemType to determine if it's a function (method) or variable (property).

@AnkurIngale
Copy link
Contributor Author

@catarak I have a doubt! Should I include all constants with itemtype=property? Because that's including some really strange variables like x,y and z.

@catarak
Copy link
Member

catarak commented Apr 11, 2019

looking over data.json, i think for itemType=property, you also need to look at the class. for example, x, y, and z, are properties of p5.Vector, and the class for them is p5.Vector, whereas for mouseX, the class is just p5. i think you can ignore the ones that are not p5, but i'm not totally sure. there may be some edge cases.

@AnkurIngale
Copy link
Contributor Author

@catarak I have added them. Just check if some methods or variables have to be removed?

@catarak
Copy link
Member

catarak commented Apr 12, 2019

this is working great for me, and the dom/sound variables are included! woohoo!

@catarak catarak merged commit 94eb6f1 into processing:master Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing p5.js keyword/function highlights
2 participants