vscode-explicit-folding icon indicating copy to clipboard operation
vscode-explicit-folding copied to clipboard

Folding rules scoped for specific filenames?

Open daiyam opened this issue 3 years ago • 2 comments

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 avatar Aug 13 '22 14:08 daiyam

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

daiyam avatar Aug 13 '22 14:08 daiyam

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.

depascalis avatar Aug 13 '22 15:08 depascalis

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

daiyam avatar Nov 11 '22 10:11 daiyam

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

Thanks

depascalis avatar Nov 11 '22 17:11 depascalis

I will change to the following config:

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

daiyam avatar Nov 12 '22 14:11 daiyam

The feature is available in the latest release.

daiyam avatar Nov 12 '22 19:11 daiyam

You're awesome, thank you!

depascalis avatar Nov 17 '22 15:11 depascalis

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

daiyam avatar Nov 18 '22 10:11 daiyam

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

depascalis avatar Nov 18 '22 20:11 depascalis

OH!

daiyam avatar Nov 18 '22 20:11 daiyam