-1

After I update Visual Studio Code to the latest version (version 1.22, refer: Release Note for Visual Studio Code 1.22), the code folding does not work. It looks like the folding does not work for else if statement.

Here is what I mean: no folding for else if statement

but code folding here?

李仕臣
  • 11
  • 1
  • 2

3 Answers3

7

In VS Code editor settings add this

"editor.foldingStrategy": "indentation"
Adeel Imran
  • 13,166
  • 8
  • 62
  • 77
0

I am using latest version (version 1.22) of VSCode as well. For JavaScript I am working on, I find out when the else if is like this:

} else if (...) {

The code folding does not work. However if I move the else to next line:

}
else if (...) {

The code folder does work.

Maybe you could consider moving the else if to next line?

0

This is a bug. Please file a new issue against vscode here.

The fix is likely to disable syntax aware folding by setting:

"typescript.experimental.syntaxFolding": false,
Matt Bierner
  • 58,117
  • 21
  • 175
  • 206