Vetur: Can't fold code in template region with pug

Created on 22 Sep 2020  路  5Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ

Info

  • Platform: macOS
  • Vetur version: v0.27.3
  • VS Code version: 1.59.1

Problem

Can't collapse code in template region with lang="pug" (similar to https://github.com/vuejs/vetur/issues/2234)

Reproducible Case

Create vue template like this:

.vue <template lang="pug"> .parent .children .grand-children p sometext .grand-children p sometext </template>
Without vetur it will collapse as expected, but not with vetur enabled.

bug pug folding

Most helpful comment

Temporary Solution:

// vscode settings.json
{ "editor.foldingStrategy": "indentation" }

All 5 comments

If you want this you'll lose JS #region folding.

stylus also has this problem

stylus also has this problem

I think you need to open another issue.

Temporary Solution:

// vscode settings.json
{ "editor.foldingStrategy": "indentation" }

Or like this:

// vscode settings.json
{
    "[vue]": {
        "editor.foldingStrategy": "indentation"
    }
}
Was this page helpful?
0 / 5 - 0 ratings