[swift-dev] Shipping sourcekitd-test/repl with Swift

Keith Smiley k at keith.so
Sun Jul 31 23:46:08 CDT 2016


Hey everyone,

Recently I've been working on making Swift autocomplete outside of Xcode
(specifically vim). Of course to do this, I've been using [SourceKitten][0],
which is a great bridge for interacting with `sourcekitd`.

While working on this, I also ran across `sourcekitd-test` and `sourcekitd-repl`
from the Swift repo. These tools are also awesome for working with `sourcekitd`.
`sourcekitd-test` even has practically the same command line interface as
SourceKitten's complete command.

With `sourcekitd-test`:

```
$ sourcekitd-test -req=complete -offset=x file.swift -- [compiler args]
```

With SourceKitten:

```
$ sourcekitten complete --offset x --file file.swift -- [compiler args]
```

These 2 commands of course call through to `sourcekitd` in the same way, so this
ends up with the same output as well.

All of this is just to show that I think these tools would be extremely valuable
to have shipped with whichever Swift toolchains are bundled with Xcode, so users
would automatically have tools for completion installed.

I'd love to hear some thoughts on this, and also if it's even a feasible thing
to ask for. Also let me know if this post would be better suited for another
list. I didn't feel like this was particularly appropriate for swift-evolution
since there aren't really any implementation details in question here.


[0]: https://github.com/jpsim/SourceKitten


Thanks for reading!

--
Keith Smiley



More information about the swift-dev mailing list