Skip to content
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

Anonymous and inline class declaration syntax highlighting broken #222

Merged
merged 2 commits into from
Sep 11, 2016

Conversation

vgel
Copy link
Contributor

@vgel vgel commented Aug 11, 2015

As seen here:

image

All those class declarations are valid coffeescript, but only the last is highlighted.

Code shown above for reference:

foo = new class extends Bar
    constructor: ->
        # sadness :(

foo = new class Baz extends Bar
    constructor: ->
        # also broken

foo = new (class extends Bar
    constructor: ->
        # parenthesizes alone don't fix it
)

foo = new (class Baz extends Bar
    constructor: ->
        # but naming + parenthesizes do
)

@markalfred
Copy link
Contributor

This should be resolved by the regex here: #200 (comment) I'll try to open up a PR tonight unless someone else can hit it first 👍

@vgel
Copy link
Contributor Author

vgel commented Aug 11, 2015

I pulled in those regexes to my fork and it partially, but not entirely fixes the problem:

image

I'm not sure why, because the regex seems to match. Maybe the new regex is taking precedence?

image

I'll take a look at this more later tonight.

@vgel
Copy link
Contributor Author

vgel commented Aug 11, 2015

Yeah, that was it. Adding a similar fix to new to not match class makes everything work:

image

Will submit the pull in a bit.

@vgel
Copy link
Contributor Author

vgel commented Aug 11, 2015

Used http://issue2pr.herokuapp.com to turn this issue into a pull request with the fixes, in case of confusion.

@markalfred
Copy link
Contributor

Very nice, @Rotten194, and +1 for introducing me to issue2pr

@aponxi aponxi merged commit ca05d05 into SublimeText:master Sep 11, 2016
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.

3 participants