Getting SourceKit-LSP working for iOS projects: cocoapods or carthage

Wondering if anyone has any ideas on how to get sourcekit-lsp working for iOS projects with an iOS package manager?

I'm sure I'm not alone: I use emacs for everything else, using XCode only for iOS projects. I have very little knowledge of xcode's build system and if its build artifacts are even compatible with sourcekit-lsp, and there's little documentation out there other than some loose-end blog posts about it.

See this thread. Whether using cocoapods or carthage it is still the produced Xcode project and its build system that determines the compiler arguments to pass.

+1

Also: Is it possible to embed SourceKit-LSP in my Mac app or even compile it into my Mac project? I want to use its API directly instead of instantiating it as a separate process.

Edit: Oh, I guess that other thread "Xcode project support?" targets my question, I'm not sure what "Xcode projects in SourceKit-LSP, alongside SPM" means ...

That thread is asking whether SourceKit-LSP would natively support Xcode projects, in addition to natively supporting Swift Package Manager projects. As I mentioned, "supporting cocoapods or carthage" essentially boils down to supporting Xcode projects.

SourceKit-LSP is a package separated into libraries, you can depend on it and use its libraries directly.

1 Like

Thanks a for the clarification, I'll try it out soon :slight_smile:

For now, I just wonder how this will work since the SourceKit-LSP Package.swift declares no products, but I guess I can import the target modules anyway :thinking: