Code folding does not work in Xcode 9.0 beta 2

I often use frequent code addition in Xcode. I recently tried code folding in Xcode 9 beta with the shortcut Command + alt + left arrow , and nothing happened.

So, I tried to do the same with the editor option in the menu bar, but it looks like the code folding function is disabled. How to enable the code folding function in Xcode 9 and make it work again, as in Xcode 8.

Picture

+5
source share
3 answers

See release notes. Code folding is not yet supported in beta 3:

The original editor for this beta version of Xcode 9.0 does not support code folding. (29396003).

According to the WWDC presentation, they made quite a serious correspondence with the editor, so do not be surprised if they need some time to nail it all.

And as with all beta software, I would suggest that you carefully read the release notes, as there are many open issues that are well documented there.


Code folding now works in beta 5.

+5
source

Code folding now works, in Xcode 9 Beta5 according to beta: Solved in Xcode 9 beta 5 - IDE

Here's how:

  • Press and hold the ctrl (control) button on the keyboard and drag / mouse over any (start or end) curly braces. It will automatically highlight the block area.
  • Hold ( ctrl ) ctrl (control) pressed and click on the selected area. This will allow you to quickly open the menu window with the Fold option.
  • Select Fold from the menu list. It will add your code and display 3 points, folding / closing the entire block.
  • Now, to expand your code block again, release the ctrl (control) button and click on 3 points, folding the block.

For convenience, see this snapshot:

enter image description here

All manual cuts also work.

 Fold ⌥ ⌘ ← option + command + left arrow Unfold ⌥ ⌘ → option + command + right arrow Unfold All ⌥ U option + U Fold Methods & Functions ⌥ ⌘ ↑ option + command + up arrow Unfold Methods & Functions ⌥ ⌘ ↓ option + command + down arrow Fold Comment Blocks ⌃ ⇧ ⌘ ↑ control + shift + command + up Unfold Comment Blocks ⌃ ⇧ ⌘ ↓ control + shift + command + down Focus Follows Selection ⌃ ⌥ ⌘ F control + option + command + F Fold All ⌘ ⌥ ⇧ ← command + option + shift + left Unfold All ⌘ ⌥ ⇧ → command + option + shift + left 

Here is a snapshot of ref:

enter image description here

+8
source

In Xcode 9 build 9A235, code folding does not always open methods when you click on 3 points. When this happens, you can click the method below the one you want to open, and this sometimes works. Apple should be confused for releasing such a semi-baked feature. What's more, the boxes around the folded methods don't add value and are just superfluous, unnecessary, mess.

0
source

Source: https://habr.com/ru/post/1269706/


All Articles