Swiftformat: Xcode source editor extension not visible in System Preferences - Extensions

Created on 28 Oct 2019  路  5Comments  路  Source: nicklockwood/SwiftFormat

I have used swiftformat successfully since mid-2018, mainly via Editor Extension in Xcode.

However, after installing macOS 10.15 and Xcode 11.1 the Extension menu items (Format Entire File, Format Selected Source) disappeared from the Xcode Editor menu.

I pulled the project from https://github.com/nicklockwood/SwiftFormat.git and ran SwiftFormat for Xcode.app, then looked into System Preferences - Extensions, but I found no trace of Xcode extensions or swiftformat therein.

Next, I built and run the scheme SwiftFormat for Xcode. The app dialog popped up, but again there was no new entry in System Preferences - Extensions.

Am I missing something?
Any advice on how to proceed?
Is there a log file that would indicate the problem?

Most helpful comment

OK, I found a solution to my problem.

The article Xcode鈥婯it and Xcode Source Editor Extensions by Zo毛 Smith, March 25th, 2019, says:

_Finally, when multiple copies of Xcode are on the same machine, extensions can stop working completely. In this case, Apple Developer Relations suggests re-registering your main copy of Xcode with Launch Services (it鈥檚 easiest to temporarily add lsregister鈥檚 location to PATH first):_

$ PATH=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support:"$PATH"
$ lsregister -f /Applications/Xcode.app

Indeed, before installing Xcode 11.0, I kept the previous app, renamed to Xcode1030.app.

I ran above commands, and lo, the swiftformat extension is now in seen in Extensions, enabled.
And in Xcode, the Editor - SwiftFormat menu items are at their usual place, together with my shortcut ^s for Format Entire File.

Screenshot 2019-10-28 at 19 58 31

All 5 comments

OK, I found a solution to my problem.

The article Xcode鈥婯it and Xcode Source Editor Extensions by Zo毛 Smith, March 25th, 2019, says:

_Finally, when multiple copies of Xcode are on the same machine, extensions can stop working completely. In this case, Apple Developer Relations suggests re-registering your main copy of Xcode with Launch Services (it鈥檚 easiest to temporarily add lsregister鈥檚 location to PATH first):_

$ PATH=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support:"$PATH"
$ lsregister -f /Applications/Xcode.app

Indeed, before installing Xcode 11.0, I kept the previous app, renamed to Xcode1030.app.

I ran above commands, and lo, the swiftformat extension is now in seen in Extensions, enabled.
And in Xcode, the Editor - SwiftFormat menu items are at their usual place, together with my shortcut ^s for Format Entire File.

Screenshot 2019-10-28 at 19 58 31

Makes sense, thanks for following up 馃憤

nice

OK, I found a solution to my problem.

The article Xcode鈥婯it and Xcode Source Editor Extensions by Zo毛 Smith, March 25th, 2019, says:

_Finally, when multiple copies of Xcode are on the same machine, extensions can stop working completely. In this case, Apple Developer Relations suggests re-registering your main copy of Xcode with Launch Services (it鈥檚 easiest to temporarily add lsregister鈥檚 location to PATH first):_

$ PATH=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support:"$PATH"
$ lsregister -f /Applications/Xcode.app

Indeed, before installing Xcode 11.0, I kept the previous app, renamed to Xcode1030.app.

I ran above commands, and lo, the swiftformat extension is now in seen in Extensions, enabled.
And in Xcode, the Editor - SwiftFormat menu items are at their usual place, together with my shortcut ^s for Format Entire File.

Screenshot 2019-10-28 at 19 58 31

nice锛宼hanks

Great tipp! This should be included in the FAQ / Known Issues section!

Every once in a while the "SwiftFormat" menu gets missing in my Xcode installation and this helps!

OK, I found a solution to my problem.

The article Xcode鈥婯it and Xcode Source Editor Extensions by Zo毛 Smith, March 25th, 2019, says:

Thank you for posting this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

igorkulman picture igorkulman  路  3Comments

dcramps picture dcramps  路  3Comments

meherkasam picture meherkasam  路  3Comments

shawnkoh picture shawnkoh  路  3Comments

DavinAhn picture DavinAhn  路  4Comments