How can I turn on parenthesis matching in Xcode?
Asked Answered
S

7

18

Curly brace matching was pretty easy to turn on. How can I turn on parenthesis matching in Xcode?

Selfimprovement answered 5/6, 2009 at 4:47 Comment(0)
N
3

You must be running Xcode in Snow Leopard and install Xcode from the Snow Leopard disc that you got at WWDC. If you did not get a Snow Leopard disk, then you are out of luck unless you find one elsewhere.

The version of Xcode needed is 3.2 and the other components in the about page are:

Component versions

  • Xcode IDE: 1600.0
  • Xcode Core: 1599.0
  • ToolSupport: 1591.0
Nylon answered 13/6, 2009 at 5:16 Comment(0)
H
27

on Xcode Version 6.1 (6A1052d), you just need to double click on one of the parenthesis and the entire code that the parenthesis is scoping out is highlighted.

for example, if you have a code like the one below and you double click '{' or '}' bracket the entire code in their scope is highlighted :

if(condition == true) { //do something }

Heartstrings answered 25/6, 2015 at 12:38 Comment(2)
Could you please elaborate more your answer adding a little more description about the solution you provide?Vagary
This is really helpful even though apple suggests to click on the left side of the line developer.apple.com/library/ios/recipes/…Subsonic
R
25

Choose editor -> code folding -> focus

Renitarenitent answered 1/2, 2014 at 6:0 Comment(0)
T
13

Edit

In XCode 9 the only solution is to put mouse over parentheses while pressing command button. Only this works.

Previous

To extend the other answers it is possible to roll in/out code inside brackets.

Choose Editor > Structure > Balance Delimiter

url

Nevertheless, as already written earlier, the major feature is

Editor > Code Folding > Focus Follows Selection

Trivalent answered 16/6, 2016 at 10:53 Comment(0)
F
5

press command key and its hover the brace and parenthesis ...

enter image description here

enter image description here

Favianus answered 27/7, 2020 at 8:13 Comment(0)
N
3

You must be running Xcode in Snow Leopard and install Xcode from the Snow Leopard disc that you got at WWDC. If you did not get a Snow Leopard disk, then you are out of luck unless you find one elsewhere.

The version of Xcode needed is 3.2 and the other components in the about page are:

Component versions

  • Xcode IDE: 1600.0
  • Xcode Core: 1599.0
  • ToolSupport: 1591.0
Nylon answered 13/6, 2009 at 5:16 Comment(0)
P
2

Please have a look at below answer for Xcode 9.0 and above:

Xcode highlights an opening delimiter (brace, bracket, parenthesis) when you move the cursor left-to-right over the matching closing delimiter. The highlight animation lasts about 1 second total, which is plenty in the case where you need a hint (and as you say the other delimiter is nearby).

If you need a more persistent indication, you can double-click either the opening or the closing delimiter, and Xcode will select both delimiters and their contents. (You can also use this, for example, to get quickly to one delimiter from another, even if they're far apart — double-click the delimiter you can see, use the left or right arrow to get the other end of the selection.)

Piaffe answered 20/12, 2017 at 6:4 Comment(1)
One second is far from plenty the moment SwiftUI arrived and you are pretty much forced to hold large chunks of meaningful code on your views, or you have a somewhat complex method. It's a very bad UX choice to make it dissappear and to go use the sloppy way of click, hold cmd and scroll to look for it with no visible hint on the scrollbar or the edge for example. But hey, it's XCode, what else can we expect.Weatherproof
B
2

With latest xcode13 we can permanent active this option with

"Xcode" --> "Preference" ---> "Text Editing" and by enabling "Code folding ribbon" 

enter image description here

Thanks

Barros answered 22/10, 2021 at 9:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.