-1

With one line guard Xcode 12 make right indentation:

guard let contentName = vod.name else {
    Log.fault("No data.")
    return
}

but with multiline, the indentation is broken:

guard let contentName = vod.name,
      let season = vod.season else {
          Log.fault("No data.")
          return
      }

Am I doing something wrong or there are someone with the same problem?

Nike Kov
  • 12,630
  • 8
  • 75
  • 122
  • I've made a feedback: `FB9974879 (Indentation wrong for multiline.)` in https://feedbackassistant.apple.com/feedback/9974879 – Nike Kov Apr 06 '22 at 07:51

2 Answers2

0

I can reproduce this with Xcode 13.1

Interestingly it works fine for multi-line if let.

The "Preferences/Text Editing/Indentation"-menu does not offer any option to fix this.

I have submitted a bug report in the Apple feedback assistant (FB9958961, it's probably non-public?).
I am afraid that is all we can do at this point:

  • raise awareness for the issue through a Stack Overflow posting ✅
  • file a bug report ✅
  • consider using AppCode instead of Xcode …
de.
  • 7,068
  • 3
  • 40
  • 69
0

In Xcode Version 13.3.1 (13E500a) it seems to be fixed

Nike Kov
  • 12,630
  • 8
  • 75
  • 122