SwiftFormat is disabled in Xcode 12 Beta 5

Created on 19 Aug 2020  ยท  7Comments  ยท  Source: nicklockwood/SwiftFormat

Installed SwiftFormat today, but can't get it to work.
I can see the option SwiftFormat in Xcode Editor menu, but it's disabled.

I've just installed Xcode 12 Beta 5. I'm on macOS 11.0-beta (20A5343i).

I read in the release-notes that extension should work in Xcode 12.

I've activated the extension etc.

known issue

Most helpful comment

Installed SwiftFormat today, but can't get it to work.
I can see the option SwiftFormat in Xcode Editor menu, but it's disabled.

I've just installed Xcode 12 Beta 5. I'm on macOS 11.0-beta (20A5343i).

I read in the release-notes that extension should work in Xcode 12.

I've activated the extension etc.

How to build the source code on our mac:

Open terminal and enter below codes respectively:
cd Desktop
git clone https://github.com/nicklockwood/SwiftFormat.git

Open .xcodeproj file in Project Folder

finder

This repo will open in Xcode. After then press โŒ˜+1 and follow the path in the picture ๐Ÿ‘‡๐Ÿป
(Select team for every section at 2nd)

Screen Shot 2020-08-23 at 13 01 31

and select "SwiftFormat for Xcode" and run "My Mac"

Screen Shot 2020-08-23 at 13 06 57

and the app is opening

Screen Shot 2020-08-23 at 13 08 47

go to --> System Preferences - Extensions - Xcode Source Editor (at the left menu) - Check the SwiftFormat

Screen Shot 2020-08-23 at 13 23 14

  1. Restart Xcode
  2. Press โŒ˜+, (Open Preferences)
  3. Go to the Key Bindings section and write "swiftformat" in filter text field
  4. Assignment any key binding for code format (like as โŒ˜+โŒฅ+L)
    Now you can format your codes at working the file

Screen Shot 2020-08-23 at 13 08 47

All 7 comments

Deprecations
For compatibility with new security features in macOS 11, Xcode extensions must be built using Xcode 12 and must embed XcodeKit.framework. An Xcode extension rebuilt with these tools remains compatible with older versions of Xcode and macOS. (51822755)

@weenzeel @hovaks ah, apologies then - I've linked XcodeKit but not built with Xcode 12. You'll need to build it yourself from source.

It works fine with Xcode 12 Beta 5 on 10.15.6 fwiw.

Installed SwiftFormat today, but can't get it to work.
I can see the option SwiftFormat in Xcode Editor menu, but it's disabled.

I've just installed Xcode 12 Beta 5. I'm on macOS 11.0-beta (20A5343i).

I read in the release-notes that extension should work in Xcode 12.

I've activated the extension etc.

How to build the source code on our mac:

Open terminal and enter below codes respectively:
cd Desktop
git clone https://github.com/nicklockwood/SwiftFormat.git

Open .xcodeproj file in Project Folder

finder

This repo will open in Xcode. After then press โŒ˜+1 and follow the path in the picture ๐Ÿ‘‡๐Ÿป
(Select team for every section at 2nd)

Screen Shot 2020-08-23 at 13 01 31

and select "SwiftFormat for Xcode" and run "My Mac"

Screen Shot 2020-08-23 at 13 06 57

and the app is opening

Screen Shot 2020-08-23 at 13 08 47

go to --> System Preferences - Extensions - Xcode Source Editor (at the left menu) - Check the SwiftFormat

Screen Shot 2020-08-23 at 13 23 14

  1. Restart Xcode
  2. Press โŒ˜+, (Open Preferences)
  3. Go to the Key Bindings section and write "swiftformat" in filter text field
  4. Assignment any key binding for code format (like as โŒ˜+โŒฅ+L)
    Now you can format your codes at working the file

Screen Shot 2020-08-23 at 13 08 47

Thank you @kadir-ince for the excellent work-around write up!

Wasn't this fixed in PR https://github.com/nicklockwood/SwiftFormat/pull/669?

Should be just a case doing your own build.

Edit
I see you're sorted.
Should have read to the end, I guess!

@weenzeel as of version 0.46.3 the bundled Extension should work in Xcode 12.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaxDesiatov picture MaxDesiatov  ยท  3Comments

Cyberbeni picture Cyberbeni  ยท  4Comments

DagAgren picture DagAgren  ยท  4Comments

sebastianfrelle picture sebastianfrelle  ยท  4Comments

dcramps picture dcramps  ยท  3Comments