MhMadHamster / vscode-postcss-language

postcss syntax support extension for VSCode
MIT License
34 stars 7 forks source link

Syntax uses // instead of /* */ as comment #23

Closed pietrofxq closed 6 years ago

pietrofxq commented 6 years ago

When using the postcss syntax, the command Toggle Line Comment adds a commentary to the css line using two slashes:

image

This syntax is from SASS commentaries, so this extension should add a comment with the original css syntax:

image

Manc commented 6 years ago

Looks like there is already a closed ticket #20 and a merged solution #17, but it looks like it's not been published yet. I was looking for a way to override this via the config, but didn't find a solution.

MhMadHamster commented 6 years ago

new version published

reblws commented 6 years ago

Hey I'm still getting this issue in VSCode. Does this need to be configured?

MhMadHamster commented 6 years ago

@reblws what version are you using? and what file extension, I just tested the latest version and it works how it should.

reblws commented 6 years ago

I'm on 2.1.0 -- the extension under postcss-sugarss-language in the VSCode marketplace.

Using .css extension. I didn't change "files.associations" in mysettings but I did manually set "Language Mode" to PostCSS.

reblws commented 6 years ago

I checked my mhmadhamster.postcss-language-2.1.0/configurations/language-configuration.json and it's the same as the change referenced in #17:

{
    "comments": {
        // symbols used for start and end a block comment. Remove this entry if your language does not support block comments
        "blockComment": [ "/*", "*/" ]
    },
    // symbols used as brackets
    "brackets": [
        ["{", "}"],
        ["[", "]"],
        ["(", ")"]
    ],
    // symbols that are auto closed when typing
    "autoClosingPairs": [
        ["{", "}"],
        ["[", "]"],
        ["(", ")"],
        ["\"", "\""],
        ["'", "'"]
    ],
    // symbols that that can be used to surround a selection
    "surroundingPairs": [
        ["{", "}"],
        ["[", "]"],
        ["(", ")"],
        ["\"", "\""],
        ["'", "'"]
    ]
}
reblws commented 6 years ago

I realized that if I hit the shortcut for Toggle Block Comment it uses the right symbols. I was hitting the shortcut for Toggle Line Comment before.

It's a little confusing since hitting Toggle Line Comment outputs //, but in the default CSS language settings Toggle Line Comment outputs /* */