b-g / processing-sublime

A Sublime Text package for the programming language Processing
MIT License
448 stars 60 forks source link

Rebuild the processing syntax highlighter using java as a base #77

Closed kylefleming closed 9 years ago

kylefleming commented 9 years ago

@b-g @ybakos Give this version a try. I did a screenshot compare of some of my pde files and in each case the highlighting was improved and no highlighting was lost from what I can tell. Hopefully you find the same results!

Here's what I did for reference:

Here's a comparison to the screenshots I took in #20: screen shot 2015-06-20 at 9 22 04 pm

(and for completeness here's it compared again to the current processing highlighting) screen shot 2015-06-20 at 9 22 10 pm

ybakos commented 9 years ago

Awesome! However, two issues I see are:

  1. We should keep enum and package.
  2. Unwanted italicization of data types.
ybakos commented 9 years ago

I see now - maybe the italics in the screenshot are just part of your particular config. (In mine, datatypes are not italicized.)

ybakos commented 9 years ago

@kylefleming , actually I redact everything I said and I do like your approach. Every other way just doesn't make sense. Thank you soooo much for working on this. There are some minor issues, which I will post here and also add line-by-line comments to the source.

ybakos commented 9 years ago

@kylefleming I've now spent significant time with this. Thanks again. I have one humble request and one potential flaw to point out. Screenshot below illustrates.

  1. Let's ensure that enum Foo behaves like class and interface.
  2. Dark color themes (eg. Amy, others) tend to incorrectly highlight parens and/or braces. May be a bug in the relevant regex.... or perhaps the color themes themselves, but I'm mentioning it here. Screenshot illustrates.

screen shot 2015-06-21 at 1 13 49 pm

I'm personally no longer concerned with the way package is/isn't handled; the default actually seems aesthetically pleasing across many different color themes.

ybakos commented 9 years ago

@kylefleming (sorry to be so chatty) You can ignore my comments regarding the inconsistent parenthesis highlighting. This is really an issue of the particular color theme.

I guess the only issues to discuss are:

  1. Adding enum to the same / similar rule as class and interface.
  2. The impact of changing source.pde to source.processing.

/cc @b-g

kylefleming commented 9 years ago

@ybakos I'll answer your questions in order:

ybakos commented 9 years ago

Thanks @kylefleming . I think in this PR we should keep it focused to the issue at hand and ignore my comments about the Java classes, etc.

I think it's wise to:

  1. include the enum stuff (again, ignore what I said about package).
  2. Perhaps make the source.processing change in other locations.

Care to create another PR with those two changes, and close this one? (@b-g will probably chime in soon).

kylefleming commented 9 years ago

@ybakos Thanks for the code review. I added a new commit to this pull request with these changes:

b-g commented 9 years ago

Merged!

@kylefleming Many thanks for taking care of it! Finally working syntax highlighting! I added you to https://github.com/b-g/processing-sublime#acknowledgements

@ybakos Thanks for feedback, code review and spotting!

ybakos commented 9 years ago

@kylefleming Awesome, man. Thank you!

kylefleming commented 9 years ago

I'm glad it all worked out, happy to have contributed!