microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.74k stars 29.09k forks source link

SCSS: Broken syntax highlighting for nested selectors #38208

Closed spncrmoo-zz closed 6 years ago

spncrmoo-zz commented 6 years ago

Steps to Reproduce: All SCSS files now have broken syntax highlighting for nested elements since the latest update. It's the same for everyone on my team, which are split between OSX and Windows. I've done a lot of searching but somehow can't find any mention of this elsewhere, which is odd since we're all on different setups here.

screen shot 2017-11-13 at 09 59 06

Reproduces without extensions: Yes

aeschli commented 6 years ago

That's what I see in 1.18 with the Dark+ theme and no extensions installed. image

Maybe there was a change in the theme that you use?

spncrmoo-zz commented 6 years ago

Am I missing something? It also seems to be broken in your screenshot. I'm assuming that P tag is a different colour if you take it out of that nest?

Also from my original post - "Reproduces without extensions: Yes"

I've tried without any extensions whatsoever, and like I said it's on multiple machines.

aeschli commented 6 years ago

Sorry, I didn't realize you only meant the p. This one in now fixed in 1.19 image

spncrmoo-zz commented 6 years ago

Ah great, thanks. It was the P and the H4 in my original screenshot, but it pretty much does it for all element selectors that are nested in any of my scss.

bartech commented 6 years ago

Same issues Not recognizing &-name as parent-selector-suffix image

looks like parsing problems as in same file later got not recognized closing brackets but selector suffix is recognized properly image

Not recognizing pseudo elements correctly and double semicolon (first one is treated as punctuation separator but second as meta property value) also opening bracket is treated as part of meta property value image

Pseudo elements recognized as support.type.property-name same as all css properties image

Treating entity.other.attribute-name.parent-selector-suffix as variable when starts with "--" image

Treating "label" tag as support.type.property-name image

Treating nested tags as meta.property-name and not as entity.name.tag image

Problem with recognizing ending brackets image

All looks like parsing problems switching to SASS syntax for same file and everything is ok image

aeschli commented 6 years ago

@bartech101 There was a grammar update for 1.19 that fixed most of the issues. 1.19 will be out in the coming days.

bartech commented 6 years ago

Most of the issues are fixed in 1.19.0 but some still exists

'cursor' property is treated as entity.name.tag image

BEM "&--modifier" recognized as variable image

animation name with "-" not recognized properly image