Open aaadotpm opened 5 years ago
Screenshot of syntax highlighting breaking
Thanks for the report - I assume for the .vue syntax highlighting you're using https://atom.io/packages/language-vue? That's what I installed to check things out -
Syntax highlighting after
@each
directive is broken.
I can reproduce on macOS 10.14.6 with 1.40.1 using:
<style lang="scss">
@each $key, $value in $map {
.color-#{$key} {
stroke: $value;
}
}
</style>
<script>
import { pie, arc } from 'd3-shape'
</script>
With the @each
:
Removing the @each
section:
So the last </style>
is highlighted correctly and the import
line has highlighting too.
Replacing the line with
'end': '\\s*(?={)'
as in the similar@if
-directive fixes the issue.See the following branch in our fork for a fix that solves the issue https://github.com/internetfriendsforever/language-sass/tree/each-directive-fix
Just wanted to check if you would you be up for opening a pull request to resolve the issue? Asking since you've done the leg-work here :smile:
Prerequisites
Description
Using
@each
SCSS directive inside a .vue file breaks subsequent syntax highlighting. Digging throughgrammars/scss.cson
it seems like'end': '\\s*((?=}))'
is incorrect.Replacing the line with
'end': '\\s*(?={)'
as in the similar@if
-directive fixes the issue.See the following branch in our fork for a fix that solves the issue https://github.com/internetfriendsforever/language-sass/tree/each-directive-fix
Commit is here https://github.com/internetfriendsforever/language-sass/commit/8e56bc8f00be3248604b53a2749dcf09029ec1f3
Steps to Reproduce
@each
directive inExpected behavior:
Normal syntax highlighting
Actual behavior:
Syntax highlighting after
@each
directive is broken. Affects both SCSS within the<style>
block and the remaining code in the document.Reproduces how often:
100% of the time for
<style lang="scss">
blocks inside a.vue
file 0% of the time in a pure.scss
file.Versions
Running Mac OS 10.14.6
Additional Information