如何在Windows的Visual Studio Code中折叠代码选择


0

在VSCode中按Ctrl + K + 0可以折叠部分代码。

if (condition) {
  # code...
}
if (condition) {
  # code...
}

会变成

+ if (condition) {...
}
+ if (condition) {...
}

是否可以将所有选择折叠到类似PHPSTORM的行中?

11 $table = $dom->createElement("Item");
12 $table->setAttribute('name', $value['title']);
13 $table->setAttribute('iconUrl', $value['pic'][0]);
14 $table->setAttribute('picUrl', $value['pic2'][0]);
15 $table->setAttribute('content', $value['notes']);

按Ctrl +。在PHPSTORM中。这些代码将成为

11+ ...

不确定PHP,但是您可以在VSCode中全部展开/折叠。看到这篇文章
jehad

Ctrl + Shift + [不能全部折叠成一行。
AllenBooTung
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.