You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I add a map to a scss file, e.g. "$map: (key1: value1, key2: value2, key3: value3);" it shows as an error. Red squiggly appears under the ":" after the first key and hover message reads ") expected". Despite the error in editor node-sass evaluates map-get correctly over it.
Reacted by Glen, scunningham777, John Woodruff, york-xtrem, Falko Schumann, Tyler Waters, Thomas Sauer, Cesar Varela, Enrico Sacchetti, Mirko Nasato and 17 more
Thanks for the pointer to stylelint. I'm guessing that should be "sass.validate": false instead of true to disable the built-in validation to allow stylelint to work without conflict?
Is there a way to vote this up? The basic template provided in a Foundation 6 project contains maps assigned to variables in the default _settings.scss file. I'm new to Sass and Visual Studio Code but so far this seems like a common use case. Thank you.
Reacted by Jonathan Gilroy-Powell, Yordis Prieto, igrek8, Ryan Wolfe, Mihai Balaceanu, Nathan Lenkowski, shaune, Georgekutty Antony, Abdelaziz Bennouna and Valentin Dzhankhotov
there's also a validation error when trying to declare a rule with a variable in its name
For example: .#{$color-type} { ... warns: [scss] at-rule or selector expected
Martin Aeschlimann (@aeschli)Erich Gamma (@egamma) Do you accept pull requests for this? And if so what do I need to do? I have the multi-arg @each working, trying to get the map assignment done atm but that's harder cause it seems to parse w/ cssParser, and it'd probably be silly to have map parsing in that
EDIT: I now more or less know how this is set up, and have real implementations for maps and multi-arg @each. I also wrote a few parsing tests, but haven't added/implemented any scope changes (it probably won't need them?) One issue I stumbled upon was that vscode is highlighting the entire map thinking it's one value tho--not sure where to look to fix that one. Anyway, my code is in my fork if you want to check them out/use them to jumpstart an official implementation
In general yes, but I defer to Martin Aeschlimann (@aeschli) whether he has specific concerns. @Aarilight pls keep in mind that we are slower to respond over the holidays and most of the team is on vacation.
Martin Aeschlimann (@aeschli) that doesn't add map support to @each, does it? @each can get a comma-separated list of variables from either map entries (two vars, one for prop and one for val), or lists within lists (in which case you can get a var for each sub-list item). Without @each support maps are still kinda annoying to work with in vscode. My fork adds in support for multi-var @each, for reference.
Activity
aeschli commentedon Jan 5, 2016
We don't support the map syntax yet
[-]scss map syntax showing as an error[/-][+][scss] scss map syntax showing as an error[/+]basvandenheuvel commentedon Jan 29, 2016
Any roadmap on when this will be solved?
egamma commentedon Jan 30, 2016
It is not on top of our backlog currently, sorry.
As a workaround you can disable the built-in validation using
EDIT corrected to
falsethanks Robert R. (@rob3c) for catching it.and install extension like stylelint.
rob3c commentedon Jun 2, 2016
Thanks for the pointer to
stylelint. I'm guessing that should be"sass.validate": falseinstead oftrueto disable the built-in validation to allow stylelint to work without conflict?basvandenheuvel commentedon Jul 11, 2016
Any info on this topic :)?
senseiweb commentedon Oct 13, 2016
bumping this, check to see the current pulse - thanks.
VishalGulati commentedon Nov 7, 2016
any update on this one? I made the setting in settings.json i.e. "sass.validate": false as suggested but still got the same error.
VishalGulati commentedon Nov 7, 2016
update: "scss.validate": false worked!!
jwatkin commentedon Nov 16, 2016
Is there a way to vote this up? The basic template provided in a Foundation 6 project contains maps assigned to variables in the default _settings.scss file. I'm new to Sass and Visual Studio Code but so far this seems like a common use case. Thank you.
gizm0bill commentedon Dec 7, 2016
there's also a validation error when trying to declare a rule with a variable in its name
For example:
.#{$color-type} { ...warns:[scss] at-rule or selector expectedChiriVulpes commentedon Dec 26, 2016
Martin Aeschlimann (@aeschli) Erich Gamma (@egamma) Do you accept pull requests for this? And if so what do I need to do? I have the multi-arg
@eachworking, trying to get the map assignment done atm but that's harder cause it seems to parse w/ cssParser, and it'd probably be silly to have map parsing in thatEDIT: I now more or less know how this is set up, and have real implementations for maps and multi-arg
@each. I also wrote a few parsing tests, but haven't added/implemented any scope changes (it probably won't need them?) One issue I stumbled upon was that vscode is highlighting the entire map thinking it's one value tho--not sure where to look to fix that one. Anyway, my code is in my fork if you want to check them out/use them to jumpstart an official implementationegamma commentedon Dec 29, 2016
@Aarilight
In general yes, but I defer to Martin Aeschlimann (@aeschli) whether he has specific concerns. @Aarilight pls keep in mind that we are slower to respond over the holidays and most of the team is on vacation.
ChiriVulpes commentedon Jan 21, 2017
Martin Aeschlimann (@aeschli) that doesn't add map support to
@each, does it?@eachcan get a comma-separated list of variables from either map entries (two vars, one for prop and one for val), or lists within lists (in which case you can get a var for each sub-list item). Without@eachsupport maps are still kinda annoying to work with in vscode. My fork adds in support for multi-var@each, for reference.support multiple variables in @each (for microsoft/vscode#1758)
aeschli commentedon Jan 23, 2017
Thanks for pointing that out. I added support for multiple variables.
Multiple variables in @each: support in scope (for microsoft/vscode#1758