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

destructuring an object within an array method #74

Closed
eballeste opened this issue Feb 22, 2018 · 5 comments
Closed

destructuring an object within an array method #74

eballeste opened this issue Feb 22, 2018 · 5 comments

Comments

@eballeste
Copy link

const { stuff } = {stuff: true};

[{stuff: true}, {stuff: false}].forEach(item => {
  const { stuff } = item;
});

looks like this:
screen shot 2018-02-21 at 11 57 06 pm

first stuff variable:

source.js 
meta.declaration.variable.js.fjsx15 
meta.binding.destructuring.mapping.js.fjsx15 
meta.block.js.fjsx15 
entity.name.variable.js.fjsx15

second one:

source.js 
meta.function-call.js.fjsx15 
meta.group.js.fjsx15 
meta.function.js.fjsx15 
meta.block.js.fjsx15 
meta.declaration.variable.js.fjsx15 
meta.binding.destructuring.mapping.js.fjsx15 
meta.block.js.fjsx15 
entity.name.variable.js.fjsx15
@borela
Copy link
Owner

borela commented Feb 22, 2018

The scopes looks correct but it is strange that material color scheme is acting this way, I'll take a look at it.

@eballeste
Copy link
Author

this one i checked with several themes and it happens it most, not all of them

@borela
Copy link
Owner

borela commented Feb 22, 2018

Found the issue, the color schemes don't have a rule for entity.name.variable.

Variables are using 2 scopes:

  • entity.name.variable when a variable is declared;
  • variable.other.readwrite for any other uses;

I was using this distinction to enable the indexer to pick variables without showing duplicates in the list; I'll do some tests if reverting it to just variable will cause any issues.

@borela
Copy link
Owner

borela commented Feb 22, 2018

Updated the variables' scopes to use variable.other.readwrite and it caused no issues; https://github.com/borela/naomi/releases/tag/v3.6.1

It'll probably solve this issue.

@eballeste
Copy link
Author

works! awesome!

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