KSImageNamed-Xcode icon indicating copy to clipboard operation
KSImageNamed-Xcode copied to clipboard

Swift support

Open Isuru-Nanayakkara opened this issue 12 years ago • 39 comments

I love this plugin. Can you please make it support Swift as well?

Isuru-Nanayakkara avatar Nov 01 '14 13:11 Isuru-Nanayakkara

+1

funky-monkey avatar Nov 25 '14 13:11 funky-monkey

good

Mark-SS avatar Nov 26 '14 05:11 Mark-SS

+1

objectmethod avatar Nov 28 '14 23:11 objectmethod

+1

dimpiax avatar Dec 01 '14 13:12 dimpiax

+1

aubrey avatar Dec 05 '14 22:12 aubrey

Any hints or ideas on how to implement the Swift support?

tomaskraina avatar Dec 07 '14 15:12 tomaskraina

Take a look at IDEIndexCompletionStrategy+KSImageNamed.m and Completions.plist. That's where the checks are performed to match imageNamed methods.

ksuther avatar Dec 08 '14 00:12 ksuther

Is there any way how to debug (using lldb console, etc.) a Xcode plugin? Is it even possible as Xcode needs to be restarted to load the plugin?

tomaskraina avatar Dec 08 '14 09:12 tomaskraina

I have added the following to Completitions.plist:

    <dict>
        <key>classAndMethod</key>
        <string>named:</string>
        <key>methodDeclaration</key>
        <string>named:</string>
        <key>methodName</key>
        <string>named</string>
        <key>comment</key>
        <string>Standard NSImage/UIImage method in Swift</string>
    </dict>

However, any of the swizzled methods in IDEIndexCompletionStrategy+KSImageNamed.m are being called when I write something that ends "named:" in a swift file. The method swizzle_shouldAutoCompleteAtLocation detects the suffix correctly and returns YES, though. Any ideas how to debug it?

tomaskraina avatar Dec 08 '14 12:12 tomaskraina

I debug plugins by starting a second instance of Xcode through lldb from the command line. That way I can keep building from the original version of Xcode and relaunch and attach to a second process.

I don't have any suggestions off the top of my head with what you're running into other than to start setting breakpoints at the main swizzled methods and start tracing your way through everything, sorry. I haven't looked into how code completion works with Swift, but I'd be surprised if it's using a completely separate completion implementation (and thus require a whole lot of additional swizzling).

ksuther avatar Dec 12 '14 22:12 ksuther

+1 would love to see a new version with swift support in alcatraz

carmen-gh avatar Feb 05 '15 23:02 carmen-gh

+1

RishabhTayal avatar Feb 24 '15 22:02 RishabhTayal

+1

bumaociyuan avatar Apr 14 '15 05:04 bumaociyuan

+1

SoulArsenic avatar Apr 22 '15 03:04 SoulArsenic

+1

kylegillen avatar May 14 '15 23:05 kylegillen

+1

mdagostino avatar May 15 '15 02:05 mdagostino

+1, great plugin

zendobk avatar May 15 '15 04:05 zendobk

+1

kaunteya avatar Jul 05 '15 07:07 kaunteya

+1

Vonfry avatar Jul 11 '15 05:07 Vonfry

+1

danishin avatar Jul 14 '15 02:07 danishin