zoejessica / marker-extension

Sample project demonstrating use of an Xcode Source Editor Extension to format Swift code
20 stars 1 forks source link

Unable to find extension in Editor menu #1

Open pastcompute opened 2 years ago

pastcompute commented 2 years ago

Hi Zoe, thanks for this project, I'm trying to emulate your tutorial at https://nshipster.com/xcode-source-extensions/

I started with my own version, but have had no luck getting the extension to show in the Editor menu in Xcode, so then I cloned this project to try again. To make it work (1) I changed the bundle IDs and team so it would build as my developer account, and (2) changed the default run app as my XCode is /Applications/XCode13.2.1 and (3) changed the run argument to a folder on my machine.

I am running XCode13 on a M1 Mini with Monterey, so I'm wondering if there is anything that might have changed since you wrote the tutorial, or where I might start with debugging? Notably, I can't find the Extension ready in the log from the debugging Xcode, so I'm wondering if it just isn't loaded somehow. Whilst Xcode is up I can see the extension in the system Settings extensions list, and it is enabled there.

It is also possible I have done something entirely brainfade-worthy...

Thanks for any help you might provide!

achernenko-schibsted commented 3 months ago

I ran into this issue too.

By pure chance I opened Console.app and found this:

 IDEExtensionManager: Xcode Extension does not incorporate XcodeKit: com.example.Plugin.EditorExtension (file:///DerivedData/Plugin-bdyooeorqrtegnghrvnfxvgojehj/Build/Products/Debug/Plugin.app/Contents/PlugIns/EditorExtension.appex/)

The source editor extension target Xcode creates is misconfigured. You need to go to the target settings, then General → Frameworks and Libraries, then change XcodeKit.framework to Embed & Sign:

Screenshot 2024-03-08 at 12 02 13

This fixed the problem for me.