In this article on Xcode Source Editor extensions, it mentions that XPC is a way to circumvent the app sandbox:
The extension must be sandboxed just to be loaded by Xcode, whereas calls to SourceKit needs to be un-sandboxed, which of course won’t fly in the App Store. We could distribute independently and use an un-sandboxed XPC service embedded in the extension.
However, I'm not sure how to tie everything together to use an XPC service.
How do I tie my Xcode Source Editor extension to an XPC service?