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

[scss] scss map syntax showing as an error #1758

Closed
gregornoriskin opened this issue Jan 3, 2016 · 14 comments
Closed

[scss] scss map syntax showing as an error #1758

gregornoriskin opened this issue Jan 3, 2016 · 14 comments
Assignees
Labels
css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality
Milestone

Comments

@gregornoriskin
Copy link

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.

@joaomoreno joaomoreno added this to the Backlog milestone Jan 5, 2016
@aeschli
Copy link
Contributor

aeschli commented Jan 5, 2016

We don't support the map syntax yet

@aeschli aeschli added css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality labels Jan 5, 2016
@aeschli aeschli changed the title scss map syntax showing as an error [scss] scss map syntax showing as an error Jan 6, 2016
@basvandenheuvel
Copy link

Any roadmap on when this will be solved?

@egamma
Copy link
Member

egamma commented Jan 30, 2016

It is not on top of our backlog currently, sorry.

As a workaround you can disable the built-in validation using

    "sass.validate": false

EDIT corrected to false thanks @rob3c for catching it.

and install extension like stylelint.

@rob3c
Copy link

rob3c commented Jun 2, 2016

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?

@basvandenheuvel
Copy link

Any info on this topic :)?

@senseiweb
Copy link

bumping this, check to see the current pulse - thanks.

@VishalGulati
Copy link

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
Copy link

update: "scss.validate": false worked!!

@jwatkin
Copy link

jwatkin commented 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
Copy link

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

@ChiriVulpes
Copy link

ChiriVulpes commented Dec 26, 2016

@aeschli @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

@egamma
Copy link
Member

egamma commented Dec 29, 2016

@Aarilight

Do you accept pull requests for this?

In general yes, but I defer to @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
Copy link

@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.

aeschli added a commit to microsoft/vscode-css-languageservice that referenced this issue Jan 23, 2017
@aeschli
Copy link
Contributor

aeschli commented Jan 23, 2017

Thanks for pointing that out. I added support for multiple variables.

aeschli added a commit to microsoft/vscode-css-languageservice that referenced this issue Jan 23, 2017
@aeschli aeschli mentioned this issue Jan 23, 2017
2 tasks
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests