How to develop Swift without Xcode?

I was wondering: people who build swift using the build script without the --xcode flag (and therefore don't have an Xcode project to navigate the code), what do you use instead? What text editors or IDEs? Do they let you use auto-complete etc?

Not all of it's relevant to your question, but you might be interested in Survey: How do you build Swift? where a lot of contributors described their build setups.

Personally, I don't build in Xcode often, but I still use it for the bulk of my editing. I more or less use the setup from the first post in the thread I linked: A debug Xcode build which provides a project I can use for editing and the occasional debug session, and a release-with-asserts ninja build which I use for incremental work, running lit tests, etc. This allows me to use Xcode's autocomplete, jump to definition, etc. while still building with ninja which I've found is generally a bit faster and more reliable. I've also used VSCode a little and have found that it works pretty well too.

1 Like

That's great, the thread is really useful.

How did you setup VSCode? Did you have autocomplete or was it just for simpler edits?

I mostly just use it for simpler edits (test cases, cmake files, etc.) but I've had some success using Microsoft's C/C++ extension for autocomplete. sourcekit-lsp might be another option, although I haven't gotten around to trying it yet. Someone who uses VSCode full-time might have better recommendations

if your not reticent to spend money, clion is quite good, especially compared to xcode

(i’m not sure how it is compared to vscode though)

[edit] might have misinterpreted your question, if so, sorry bout that >_<

@andrekandore do you use clion to contribute to the Swift compiler's codebase? I've never heard of it, but it might be worth taking a look if that works

AppCode, VSCode.

i myself don’t, but if you wanted to try out different toolchains either built yourself or other versions you can point clion to use it
(and now i just realized) when you said “build swift” i interpreted it as “build (using) swift”, but you meant building swift itself, sorry for misunderstanding that >_<

Terms of Service

Privacy Policy

Cookie Policy