Skip to content

Incorrect highlighting when defining a computed method #425

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

Closed
paxunix opened this issue May 8, 2016 · 4 comments
Closed

Incorrect highlighting when defining a computed method #425

paxunix opened this issue May 8, 2016 · 4 comments
Assignees

Comments

@paxunix
Copy link

paxunix commented May 8, 2016

class Foo {
    [someThing]() {
        return 10;
    }
}

The current highlighter thinks the method body is jsClassBlock so its entire highlighting is thrown off.

@amadeus
Copy link
Collaborator

amadeus commented May 9, 2016

I believe this is some form of ES7 level functionality? I will look into it as I look to add ES7 support. Thanks for posting the issue!

@amadeus amadeus self-assigned this May 9, 2016
@paxunix
Copy link
Author

paxunix commented May 14, 2016

Computed method names (computed properties) is an ES6 feature: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions

@amadeus
Copy link
Collaborator

amadeus commented May 14, 2016

In objects yes, I believe you are correct. Curly brackets in class definitions have a different set of rules that are being expanded upon in ES7

@amadeus amadeus mentioned this issue Jun 6, 2016
amadeus added a commit that referenced this issue Jun 6, 2016
amadeus added a commit that referenced this issue Jun 6, 2016
There is one caveat right now, to properly support it, we sort of
require semicolons. Not sure if this is something people will be happy
with or not...
@amadeus
Copy link
Collaborator

amadeus commented Jun 12, 2016

Should be fixed in develop

@amadeus amadeus closed this as completed Jun 12, 2016
amadeus added a commit that referenced this issue Jun 14, 2016
There is one caveat right now, to properly support it, we sort of
require semicolons. Not sure if this is something people will be happy
with or not...
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

No branches or pull requests

2 participants