nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.9k stars 639 forks source link

Disappeared from Editor Menu #1133

Closed trahho closed 2 years ago

trahho commented 2 years ago

I use SwiftFormat for Xcode all the time. This morning it suddenly disappeared from the menu. I have no explanation. I reinstalled SwiftFormat as well as Xcode, it still does not show. I tried all the hints I found (incl. lsregister), nothing worked. Xcode Version 13.2.1 (13C100) SwiftFormat for Xcode Version 0.49.2 (1) macOS Monterey Version 12.1 (21C52) Does anyone have an idea?

pawello2222 commented 2 years ago

I had the very same problem, SwiftFormat suddenly disappeared from Xcode. Updating macOS to Monterey 12.2.1 somehow solved the issue.

pawello2222 commented 2 years ago

Unfortunately, it looks like the issue keeps coming back. Every time a new Xcode version is released, SwiftFormat disappears from the menu (even if I did not download the new Xcode version). Once I install the new Xcode, SwiftFormat automatically appears in the menu again.

I have observed this pattern three times already and I started treating it as a notification for a new Xcode version 😉

It looks like SwiftFormat is somehow checking if the user's Xcode version is the newest released and otherwise it removes itself from the menu.

nicklockwood commented 2 years ago

@pawello2222 I can assure you that this isn't anything that SwiftFormat is doing. It has no concept of which Xcode version you have installed, nor any reason to care if it's the latest version. I assuming this is caused by some kind of security feature (or possibly a bug) in Apple's app extension infrastructure.

raxityo commented 2 years ago

@pawello2222 have you tried this suggestion by @nicklockwood?

It worked like a charm for me!

pawello2222 commented 2 years ago

Xcode 13.4 released and SwiftFormat is not removed from Xcode 🎉 Maybe it was just a bug somewhere in the Apple ecosystem.

In any case thank you @nicklockwood and @raxityo for your help.

trahho commented 2 years ago

I had put it into the build process, but now I tried the extension again, and it works. SwiftFormat is a super good tool, helps me to keep my code clean. Thank you all for your help, and @nicklockwood thank you so much for this great tool.