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

[JavaScript] Fix extended anonymous class declarations #1581

Closed
wants to merge 2 commits into from

Conversation

deathaxe
Copy link
Collaborator

Fixes #1576

Issue

The extend keyword is matched as class name rather than keyword if directly following the class keyword in anonymous class definitions breaking the highlighting of the whole class body.

Solution

Pop off from class-name context, if extend was found.

Fixes sublimehq#1576

# Issue

The `extend` keyword is matched as class name rather than keyword
if directly following the `class` keyword in anonymous class
definitions breaking the highlighting of the whole class body.

# Solution

Pop off from `class-name` context, if `extend` was found.
@@ -1149,6 +1149,8 @@ contexts:
- include: expression-begin

class-name:
- match: (?=\bextends\b)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In accordance with the new identifier parsing, this should be (?=extends{{identifier_break}}). Otherwise, it will fail on class extends$ {}.

@Thom1729
Copy link
Collaborator

My bad. Thanks for fixing it.

@deathaxe deathaxe closed this May 24, 2018
@deathaxe deathaxe deleted the pr/js-fix-1576 branch May 27, 2018 13:56
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.

2 participants