-
Notifications
You must be signed in to change notification settings - Fork 68
Support for Swift #13
Comments
I agree, this would be really great! The first thing to do would be to find a framework that can extract the relevant information from Swift code. Probably this would be some kind of compiler or language server. If running it on some Swift code yields the resired outcome (e.g. finding symbol definitions and relations (e.g. calls, usages, etc.) between those symbols), the next step would be to extend SourcetrailDB with bindings to whatever language the framework that we found is written in. You can find a small step by step description of this process in our Language Extension Guide If you or anyone else has some experience with Swift and know or can find a framework to use, please let us know! |
I do have experience with Swift, so I'm ready to help. Just need to check the compiler or language server part of the process... So any help is welcome Swift has a way to access the AST by using the command line or the library xcrun swiftc -frontend -emit-syntax ./File.swift The result is a JSON, which may be problematic or not??? |
Swift is statically typed, so writing Swift language support for Sourcetrail with full coverage of the indexed code should be doable! Ok, to get started, please read the "First Things First" section of the language extension guide linked above to get an estimate on what we need to continue :) |
I've read the First Things First and pretty much the rest of the doc and to be honest I'm kind of lost... perhaps is just me |
What are your questions? Maybe I can help :) |
Why is this issue closed? @BrunoMiguens Swift has a language server protocol |
@ZkHaider, right. Swift support has not been implemented, so we can keep this one open. |
Since there has been no progress regarding Swift or as far as I see adding a language server protocol. Has anyone looked into SoureKit? There is a Swift implementation to communicate with it (but it can also be run as in the command line): |
Looks like SourceKit would be suitable for doing the heavy lifting for a Sourcetrail indexer. But that would just work for Mac OS, right? |
SourceKitten:
So the only system I don't know about is Windows. One question I have is about interoperability between languages. Do we have to write an entire indexer for Swift -> Obj-C -> Obj-C++ -> C++ (where I guess that Obj-C and C++ will cover the Obj-C++ part)? |
Would be awesome to have support for Swift.
I'm available to help you out!
The text was updated successfully, but these errors were encountered: