Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode source editor extension not visible in System Preferences - Extensions #494

Closed
rudifa opened this issue Oct 28, 2019 · 14 comments
Closed

Comments

@rudifa
Copy link
Contributor

rudifa commented Oct 28, 2019

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?

@rudifa
Copy link
Contributor Author

rudifa commented Oct 28, 2019

OK, I found a solution to my problem.

The article Xcode​Kit 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’s easiest to temporarily add lsregister’s 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

@nicklockwood
Copy link
Owner

Makes sense, thanks for following up 👍

@limuyang2
Copy link

nice

OK, I found a solution to my problem.

The article Xcode​Kit 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’s easiest to temporarily add lsregister’s 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,thanks

@klaas
Copy link

klaas commented Dec 15, 2019

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!

@drewolbrich
Copy link

OK, I found a solution to my problem.

The article Xcode​Kit and Xcode Source Editor Extensions by Zoë Smith, March 25th, 2019, says:

Thank you for posting this.

@erdemildiz
Copy link

Its worked @limuyang2 🎉

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

@MagnoUrbano
Copy link

not working for me, unfortunately.

@dagronf
Copy link

dagronf commented Jun 30, 2023

I noticed with Xcode 14 that once I upgraded using the brew cask method I could not get it to re-appear in Xcode 14. However, if I downloaded and installed the application from the releases tab it reappeared.

May be of use (at least to myself when I come looking for this again in a year or so's time :-) )

@pupubird
Copy link

In my case is that, once you done with brew install, go to "Applications > SwiftFormat for Xcode" and simply double click to open it

@SeanWit
Copy link

SeanWit commented Dec 6, 2023

Thank you for your guidance, it solved the issue of the Xcode 15 editor menu not displaying for me.

@bdube
Copy link

bdube commented Feb 4, 2024

I noticed with Xcode 14 that once I upgraded using the brew cask method I could not get it to re-appear in Xcode 14. However, if I downloaded and installed the application from the releases tab it reappeared.

May be of use (at least to myself when I come looking for this again in a year or so's time :-) )

Thank you. This worked for me too.

Xcode 15.2
Sonoma 14.3
SwiftFormat 0.53.1 from GitHub releases

Opened /Applications/SwiftFormat for Xcode.app and then enabled extension in System Settings -> Privacy & Security -> Others, Extensions -> Xcode Source Editor -> ☑️ SwiftFormat

@houmie
Copy link

houmie commented Jun 3, 2024

Installing it via Brew cask no longer works. Download the zip from release and install it directly.

@rae
Copy link

rae commented Jun 17, 2024

Installing it via Brew cask no longer works. Download the zip from release and install it directly.

Just omit "cask" from the command an it will install fine.

@Scvairy
Copy link

Scvairy commented Nov 3, 2024

Installing it via Brew cask no longer works. Download the zip from release and install it directly.

Yep, it didn't show up in Xcode Extensions until I installed it directly from release.

In Sequoia it is now in System Settings → General → Login Items & Extensions → Xcode Source Editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests