Xcode 9展开/折叠括号/括号{}侧栏缺失 [英] Xcode 9 expand/collapse braces/brackets {} side bar missing

查看:214
本文介绍了Xcode 9展开/折叠括号/括号{}侧栏缺失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

找不到


Xcode▶首选项/文字编辑▶代码折叠功能区框。

Xcode ▶ Preferences/Text Editing ▶ "Code Folding Ribbon" box.


推荐答案

Xcode 10中的更新:

Updates in Xcode 10:

Xcode 10增加了对代码折叠的支持,包括:

Xcode 10 has increased support for code folding, including:


  1. 一个新的代码折叠功能区,在编辑器中显示所有多行可折叠代码块

  2. 编辑器中折叠代码的新样式,允许您编辑带折叠代码的行

  3. 支持折叠包含在卷曲中的任何代码块大括号

  4. 支持折叠色带,结构化选择或

  1. A new code folding ribbon showing all of the multi-line foldable blocks of code in the editor
  2. A new style for folded code in the editor that allows you to edit lines with folded code
  3. Support for folding any block of code enclosed in curly braces
  4. Support for folding blocks of code from the folding ribbon, from structured selection, or from the



折叠代码块


菜单栏►编辑►代码折叠►折叠菜单项

Menubar ► Editor ► Code Folding ► Fold menu item

看看这个快照:

Xcode 9

根据测试版发布说明,在Xcode 9 Beta5中Xcode 9 beta 1禁用了代码折叠:已解决Xcode 9 beta 5 - IDE

Code folding was disabled in Xcode 9 beta 1, which is working now, in Xcode 9 Beta5 according to beta release note: Resolved in Xcode 9 beta 5 – IDE

以下是:


  1. 按住键盘中的 (命令)按钮并移动/悬停鼠标光标任何(开始或结束)大括号。它会自动突出显示,阻止区域。

  2. 按住(保持) (命令)按钮条件并单击突出显示的区域。它将启用带有 折叠 选项的快捷菜单弹出窗口。

  3. 选择 从菜单列表中折叠 。它将折叠您的代码并显示3个点,折叠/覆盖整个块。

  4. 现在,再次展开您的代码块,发布 (命令)按钮并点击3个点折叠一个块。

  1. Press and hold (command) button in keyboard and move/hover mouse cursor on any (start or end) braces. It will automatically highlight, block area.
  2. Keep (hold) (command) button in pressed condition and click on highlighted area. It will enable quick menu popover window with Fold option.
  3. Select Fold from menu list. It will fold your code and shows 3 dots, folding/covering entire block.
  4. Now, to again unfold your code block, release (command) button and click on 3 dots folding a block.

为了便于理解,看看这个快照:



所有键盘快捷方式也都有效。


It's all keyboard short cuts are also working.

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



Xcode菜单中的代码折叠选项


菜单栏▶编辑器▶代码折叠▶这是代码折叠选项列表

Menubar ▶ Editor ▶ Code Folding ▶ "Here is list of code folding options"

以下是参考快照:

Xcode快捷列表中的相同选项


菜单栏▶Xcod e▶首选项▶键绑定▶这里是代码折叠短键列表

Menubar ▶ Xcode ▶ Preferences ▶ Key Bindings ▶ "Here is list of code folding short-keys"

这篇关于Xcode 9展开/折叠括号/括号{}侧栏缺失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆