alefragnani / vscode-separators

Separators Extension for Visual Studio Code
GNU General Public License v3.0
40 stars 6 forks source link

[FEATURE] - Make `separators.enabledSymbols` setting customizable _per language_ #18

Closed ctf0 closed 3 years ago

ctf0 commented 3 years ago

when working with sass,css the separators are very distracting, is it possible to add a new config to disable the ext for specific languages ?

alefragnani commented 3 years ago

Hi @ctf0 ,

I thought about that myself while testing the extension on different languages I use, but decided to keep it simple, at start.

I just wonder the best approach for that.

Thanks for reporting

ctf0 commented 3 years ago

A more complex language related setting where the user could define different settings for each language

i actually thought about that when i was creating the ticket, but i think its better to keep it simple at first, at least untill the extension get some momentum.

alefragnani commented 3 years ago

Just an update about this feature.

I learned a bit more about the topic, and it seems the per language setting is not that complex to make, nor use. The setting can be per language, but is up to the user to choose how to update the setting, globally or individually.

I’ll dig a bit more about it while doing #33 , and if it confirmed, both issues could land on the next release.

alefragnani commented 3 years ago

Instead of disabling the extension for specific languages, I'll make the separators.enabledSymbols setting to be per language.

Doing so, you will be able to customize / disable the separators on a language basis:

    // the default value, when all symbols are enabled for every language
    "separators.enabledSymbols": [
        "Classes",
        "Constructors",
        "Enums",
        "Functions",
        "Interfaces",
        "Methods",
        "Namespaces"
    ],

    // choose specific symbols for typescript 
    "[typescript]": {
        "separators.enabledSymbols": [
            "Enums",
            "Interfaces"
        ],
    },
    // choose a different set of symbols for javascript
    "[javascript]": {
        "separators.enabledSymbols": [
            "Functions"
        ],
    },

Stay tuned

ctf0 commented 3 years ago

can we make separators.enabledSymbols accept empty array so we can disable it completely for a language ?

alefragnani commented 3 years ago

It already works 😬

You can simply ignore the warning (orange wave line) while customizing User Settings. I remove the limitation in the Separators: Select Symbols command, but forgot the user setting definition.

It should fixed in a patch in a couple of days.

Thanks for reporting