This is a simple daemon that can read Xcode Swift projects and offers auto completion for Swift files and more over a built-in webserver. Effectively, this allows any kind of editor like Vim, Emacs, Sublime, or Atom to support Swift, Auto Completion, and Xcode projects.
It includes an example, very simple, Xcode like, editor (see SwiftCode folder) which explains how to use / embedd the actual SourceKittenDaemon.
Here's a video showing the example editor in action:
This app uses the fantastic SourceKitten framework without which none of this would be possible. SourceKittenDaemon is really just a small wrapper that keeps an Xcode Project indexer running and offers a nice way to query Xcode Project properties and completions via a comfortable interface.
Have a look at the Protocol.org file, which explains how to start and use the daemon.
You'll find an installable package under the releases tab
(Coming Soon)
make install
You'll find a zip file under the releases tab
Have a look at the SwiftCode example project, or at the existing editor integrations (below). Alternatively, the communication protocol is outlined in the Protocol.org file in this repository.
SourceKittenDaemon is used in the company-sourcekit Emacs Swift plugin:
autocomplete-swift is a working Atom plugin offering Swift auto completion support via SourceKittenDaemon.
There's a working implementation for TextMate here.
This is a very simple, featureless reference implementation to see how to embed SourceKittenDaemon into an editor. It offers:
This is a very simple editor and no sane person should try to write code with it. It is only meant to show how to embed the daemon.
Linux support is currently in development. If you're interested in helping out, here're the steps to run it on Linux:
docker pull ibmcom/swift-ubuntu
)make linuxtest
The X-Offset
header takes a byte offset as opposed to a character
offset. For most characters this will make no difference. However special
characters such as ©
are counted as two bytes is
UTF8. See this issue for more details.