zokugun / vscode-explicit-folding

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

Custom folding in Vue files. #70

Closed oxk4r01 closed 3 years ago

oxk4r01 commented 3 years ago

Hi. I'm triying to fold custom regions in vue files, and have this setup:

"explicitFolding.wilcardExclusions": [
    "vue"
  ],
  "explicitFolding.rules": {
    "*": {
      "begin": "//b/",
      "end": "//e/"
    }
  }

And then in the editor:

<script>
//b/
import HelloWorld from '@/components/00HelloWorld.vue'
//e/
...

But I'm not getting the supposed folding icon. Can you help me with this, please? (I'm using Vetur). Regards.

daiyam commented 3 years ago

try:

"[vue]": {
  "explicitFolding.rules": [
    {
      "begin": "//b/",
      "end": "//e/",
    },
  ]
},
oxk4r01 commented 3 years ago

There was another [vue] entry in the json, and I had to put that inside it to avoid duplicates. I did it like that, but doesn't work :(

image image

daiyam commented 3 years ago

You can test 3 things:

oxk4r01 commented 3 years ago

"Show folding controls" was already set up to "always".

image

In the other hand, setting added, but I'm not getting any Folding channel:

image

oxk4r01 commented 3 years ago

Hey, I find it. This was the problem:

image

If "folding strategy" is setup to "indentation", the extension doesn't work. When it's in "auto", the extension panel shows up in the output and the extension works as expected.

daiyam commented 3 years ago

Ok, good! I didn't think of that.

daiyam commented 3 years ago

I'm closing the issue since it has been fixed :wink: