zokugun / vscode-explicit-folding

Customize your Folding for Visual Studio Code
MIT License
95 stars 14 forks source link

Folding rules scoped for specific filenames? #87

Closed daiyam closed 1 year ago

daiyam commented 1 year ago

Discussed in https://github.com/zokugun/vscode-explicit-folding/discussions/86

Originally posted by **depascalis** August 13, 2022 Is it possible to have folding rules that only apply to specific filenames like `*.special.js` or `*.special`? If not I would like to do a feature request if it is possible to implement.
daiyam commented 1 year ago

@depascalis Yes, it's possible. I should able to implement it.

depascalis commented 1 year ago

Awesome, thank you @daiyam Btw the original question is still marked as unanswered. I don't know if this issue could be referenced as an answer for future reference.

daiyam commented 1 year ago

@depascalis I might be able to that with (not yet implemented):

"explicitFolding.rules": {
    "*.config.xml": [<your rules>],
    "*.special.js": [<your rules>],
},

Or you can create your own language as suggested by @aeschli.

depascalis commented 1 year ago

Settings syntax looks perfect! This feature would be valuable for me, and I've seen others requesting this functionality elsewhere.

Thanks

daiyam commented 1 year ago

I will change to the following config:

"[javascript]": {
    "explicitFolding.perFiles": {
        "*.special.js": [<your rules>],
    },
},
"[xml]": {
    "explicitFolding.perFiles": {
        "*.config.xml": [<your rules>],
    },
},
daiyam commented 1 year ago

The feature is available in the latest release.

depascalis commented 1 year ago

You're awesome, thank you!

daiyam commented 1 year ago

@depascalis Can you close the issue if it's working for you 😉 Thx

depascalis commented 1 year ago

@daiyam I believe you opened this issue on my behalf, I don't see the option to close it.

daiyam commented 1 year ago

OH!