11

So in Visual Studio if I have a collapsed function code, when I unfold it, it also unfolds all the ifs, switches etc. inside of it. In visual studio code hovewer if I go for Fold All (Ctrl+K Ctrl+0) then if I wanna quickly check one function (f.e unfolding it by mouse click on the cross near line numbers), it unfolds the function but it doesn't go recursively, making me to unfold every other if/else or case. Is there a way to make this work the way I would expect it?

minecraftplayer1234
  • 2,127
  • 4
  • 27
  • 57

2 Answers2

11

Try Ctrl-K Ctrl-] recursive unfolding when the cursor is on the function to unfold.

Mark
  • 143,421
  • 24
  • 428
  • 436
  • I noticed a little obscurity on this matter while reading SO. There is a big difference between `Ctrl-Shift-]`, and `Ctrl-K` `Ctrl-]`. One could think they're doing the same, but they're not. The FORMER expands the current node **not recursively**, while the LATTER does it **recursively**. But on SO none of these are really covered in the same answer! Have a look: https://stackoverflow.com/questions/30067767/how-do-i-collapse-sections-of-code-in-visual-studio-code-for-windows I don't know how to do it on SO, but we should edit the answer. – Onkeltem Jan 22 '22 at 10:22
0

Select the section and try ctrl + shift + «

Or check the unfold key command in Keyboard Shortcuts

XAronX
  • 54
  • 1
  • 10