Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Fix incorrect tokenization of SCSS class extensions #242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

croccifixio
Copy link

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

This PR prevents extended SCSS class names with 2 or more hyphens after the name break from being tokenized as variables. Consider the following code snippet:

.block {
   &__element {}
   &--modifier {}
   &.another-block {}
   &-wrapper {}
}

__element, .another-block and -wrapper are all tokenized as punctuation.definition.entity.css.

--modifier is incorrectly tokenized as variable.scss.

Alternate Designs

None.

Benefits

Proper token colorization.

Possible Drawbacks

None that I can foresee.

Applicable Issues

#241

Prevent extended SCSS class names with 2 or more hyphens after the name break from being tokenized as variables.
An example of such an instance is provided below:

```
.block {
   &--modifier {}
}
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant