I don't have experience in XcodeKit and SourceKit apart from a few articles that I read and the official pages https://developer.apple.com/documentation/xcodekit#topics https://github.com/apple/swift/tree/master/tools/SourceKit
I'm trying to understand the differences between the two and what they are capable of doing exactly.
I think XcodeKit essentially let you add commands to Xcode menu and makes it possible to interact with the source code you have open by creating an app extension which you can then also distribute through the App Store. As far as I could understand XcodeKit only let you get information from the current focused file (not all the files in project), then you can get selected text etc... At least that's what I read until Xcode 9, not sure if things are better now.
SourceKit also interacts with source code but looks like more powerful but more low level.
What I'm wondering is:
- Does SourceKit make it possible to access to all the Swift and ObjC classes that you have in your open project, and then extract informations out of it? For example let's say that I want to extract informations like structs and classes, methods of each class, and then generate some sort of output out of it. How do I use SourceKit (or XcodeKit?) to do that?
- Any link to examples would be great!
- Is SourceKit still actual and supported by Apple?
https://github.com/apple/swift/blob/master/tools/SourceKit/docs/Protocol.md
Thanks