Skip to content

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

Closed

Description

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.

Activity

  1. aeschli commented on Jan 5, 2016

    @aeschli
    Contributor

    We don't support the map syntax yet

  2. added
    css-less-scss
    feature-request
    on Jan 5, 2016
  3. changed the title [-]scss map syntax showing as an error[/-] [+][scss] scss map syntax showing as an error[/+] on Jan 6, 2016
  4. basvandenheuvel commented on Jan 29, 2016

    @basvandenheuvel

    Any roadmap on when this will be solved?

  5. egamma commented on Jan 30, 2016

    @egamma
    Member

    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 Robert R. (@rob3c) for catching it.

    and install extension like stylelint.

  6. rob3c commented on Jun 2, 2016

    @rob3c

    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?

  7. basvandenheuvel commented on Jul 11, 2016

    @basvandenheuvel

    Any info on this topic :)?

  8. senseiweb commented on Oct 13, 2016

    @senseiweb

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

  9. VishalGulati commented on Nov 7, 2016

    @VishalGulati

    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.

  10. VishalGulati commented on Nov 7, 2016

    @VishalGulati

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

  11. jwatkin commented on Nov 16, 2016

    @jwatkin

    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.

  12. gizm0bill commented on Dec 7, 2016

    @gizm0bill

    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

  13. ChiriVulpes commented on Dec 26, 2016

    @ChiriVulpes

    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

  14. egamma commented on Dec 29, 2016

    @egamma
    Member

    @Aarilight

    Do you accept pull requests for this?

    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.

  15. ChiriVulpes commented on Jan 21, 2017

    @ChiriVulpes

    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.

  16. aeschli commented on Jan 23, 2017

    @aeschli
    Contributor

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

  17. added a commit that references this issue on Jan 23, 2017
  18. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

css-less-scssfeature-request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions