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 - destructuring/spread assignment breaks syntax highlighting #70

Closed
BruOp opened this issue Feb 21, 2018 · 4 comments
Closed

Comments

@BruOp
Copy link

BruOp commented Feb 21, 2018

Here's a screenshot:
brokensyntax

Here's the repro code:

class SomeComponent extends Component {

  componentDidMount = () => {
    const { match: { params: { stepIndex }}, currentStep } = this.props;
  }

  render() {
    return null;
  }
}

function mapStateToProps(state) {
  return {};
}

export default withRouter(connect(mapStateToProps)(SomeComponent));

It works better if the spread assignment doesn't go more than one level deep:
notsobroken

class SomeComponent extends Component {

  componentDidMount = () => {
    const { match } = this.props;
  }

  render() {
    return null;
  }
}

function mapStateToProps(state) {
  return {};
}

export default withRouter(connect(mapStateToProps)(SomeComponent));
@borela
Copy link
Owner

borela commented Feb 21, 2018

Thank you for isolating the issue :D Fixed: https://github.com/borela/naomi/releases/tag/v3.5.0

@BruOp
Copy link
Author

BruOp commented Feb 21, 2018

Wow that was fast! Thanks a lot, and thanks for this package, it's great!

PS How long until that release gets pushed to Sublime's package control?

@borela
Copy link
Owner

borela commented Feb 21, 2018

I am glad it is being useful :D Package control usually update it every 2~3 hours, right now it is showing the latest version, restart sublime and it might update the package;

@BruOp
Copy link
Author

BruOp commented Feb 21, 2018

Awesome thanks! Looks like it's working now 👍

@BruOp BruOp closed this as completed Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants