Expanding Swift's IDE Support (swift.org)

by frizlab 71 comments 138 points
Read article View on HN

71 comments

[−] rockbruno 37d ago
This is a very welcome improvement but I should note the title is a bit clickbaity: using Swift on e.g. Cursor was always possible, it's just that after Microsoft banned forks from accessing the official VSCode marketplace last year you started having to workaround it by downloading and installing the .vsix file manually. Having the extension on the Open VSX Registry sorts this out so you can now install it via the proper way once more. Very happy this finally happened!
[−] mohsen1 36d ago
I'm building iOS apps without opening Xcode. All in VSCode and CLI build tools. This is excellent!
[−] jbverschoor 37d ago
Use swift as a scripting language without the slow start time:

Swift Caching Compiler - https://github.com/jrz/tools

[−] frizlab 36d ago
Is “$0” (argv[0]) correct when the pre-compiled binary is launched instead of the script?
[−] jbverschoor 36d ago
Ahh good question. I had to think a while before I understood what you meant. Let me check when I can.

Nice catch.

edit: you are right. The binary version will result in a different argv[0]. Not sure what'd the best solution would be. Hardcoding doesn't make sense, as symlinks also change argv[0], so overriding is not the way to go.

[−] philkrylov 36d ago
bash, zsh, and ksh93 support exec -a especially for this case.
[−] jgbuddy 37d ago
This is huge, long time coming. Interested to see if there is SwiftUI support.
[−] rockbruno 37d ago
This extension is for "pure" Swift development, not iOS development. I doubt the latter will ever officially happen. It's possible to make it work for iOS at an unofficial capacity though by hooking into the extension's LSP support. We did this at Spotify to enable iOS development in Cursor for Bazel iOS projects: https://github.com/spotify/sourcekit-bazel-bsp
[−] worldsavior 37d ago
You also can't do Android (app) development outside Android Studio.
[−] Antonito 37d ago
As others have stated it's possible, but might be cumbersome.

I made an example of an iOS/Android monorepo with a shared Rust core a few months ago: https://github.com/Antonito/bazel-app-core-native-example/

You do need the Android SDK to build, Android Studio makes things easier (even though the Bazel IDE plugin is a whole other topic itself..) but isn't mandatory to develop or run your app.

[−] c0balt 37d ago
Are you sure about that? Flutter development for Android works great in VS Code/Codium. The Android extension [0] for VS Code has also worked fine in the past on a small Java-based App for me.

Android Studio is a probably the best IDE for this usecase but is not the only way.

[0]: https://marketplace.visualstudio.com/items?itemName=adelphes...

[−] tadfisher 37d ago
That's just untrue on the face of it. All of the build tools are open and cross-platform. Is there a specific piece of Android Studio that you require for Android app development?
[−] manwe150 37d ago
Not certain if this answers the question, but it seemed like you're generally expected to install Android Studio to get the correct build versions of all of the tools and libraries. I guess theoretically you could repackage them yourself, but also not entirely clear why you would—other than perhaps download size. The tools can be driven externally, once installed, but so could XCode projects (with xcodebuild).
[−] cyberax 37d ago
Incorrect. You can (if you really want to) build an Android app without having any Google tools.

But even if you don't want to do any crazy stuff, Android SDK itself is just a bunch of Gradle scripts and Java apps. You can download and install them without any GUI in the way.

This is very common in CI/CD environments. Google provides a handy tool for that: https://developer.android.com/tools

Sorry, but Android and iOS are simply incomparable in their quality. Android SDK is a high-quality tool for developers that provides all the expected interfaces.

iOS SDK is a lock-in GUI hell that requires you to use a shitty macOS-only tool to even _upload_ apps to Apple Store. Never mind doing headless builds in CI/CD. Why that tool is shitty? It uses its own protocol for upload and doesn't do proper PMTU, so if you have a misconfigured MTU somewhere in the chain between you and Apple, uploads will just silently hang.

Edit: D'Oh, the correct URL for the sdkmanager is: https://developer.android.com/tools/sdkmanager

[−] myko 36d ago
what? this is super easy with vim and gradle CLI
[−] QQ00 37d ago
What's the point then? Because nobody use Swift outside of iOS app development.
[−] hyzyla 37d ago
No so straightforward, but there is project that parses xcodebuild logs and pass them to lsp to provide LSP for SwiftUI projects https://github.com/SolaWing/xcode-build-server

Also I build extra tooling to facilitate iOS development in VSCode https://github.com/sweetpad-dev/sweetpad

[−] nielsbot 37d ago
What type of support do you mean? Language checking? Live previews?
[−] pezgrande 36d ago
I hate that I need to create an Apple account (with email and phone verification) just to be able download the sdk to use MacOS APIs. To make things worse I tried for like one hour to create an account and couldn't because for some reason I was no receiving the verification email.
[−] randomNumber7 37d ago
I think swift is a really great language from the design perspective.

What makes it unusable outside the apple ecosystem imho is that while the C interop is amazing on paper, it sucks hard in practice due to the abomination of pointer types they build in.

The "all pointers are evil" attitude doesn't help when you want to use a C library and noone will write rewrite all these libraries.

[−] vyr 37d ago
i was hoping this was going to be AppCode rising from the grave but nah it's just more rebranded versions of VSCode. nothing new here
[−] inatreecrown2 37d ago
I recently started to enjoy working in Xcode more than before, using Swift. Not sure what changed, but it seems more responsive for lack of a better expression.
[−] hbn 37d ago
Now if only they'd open up iOS development so we can get AppCode back.

The primary thing keeping me away from trying it again is I have to use Xcode instead of my beloved JetBrains IDEs where I know all the keyboard shortcuts.

[−] eptcyka 36d ago
But can I develop iOS apps with vim? As in, easy to execute commands for debugging, running app and tests?
[−] MaysonL 37d ago
Is there an open—source Swift IDE that can modify itself without restarting? (written in Swift) I loved Oberon µSystems Oberon/F aka Component Pascal for that capability.

Or am I going to have to vibe-code one.

[−] castral 37d ago
The loss of AppCode from Jetbrains was a huge blow to my motivation to continue working with Swift. Xcode just can't compare.
[−] aabhay 37d ago
We’ve used SweetPad and it worked fine for us, so this doesn’t change much.
[−] wiseowise 36d ago
Everyone should post to open-vsx by default.
[−] w10-1 37d ago
TLDR: same VScode extension now listed on OpenVSX registry, for Eclipse Theia et al.

But it's unclear if they tested it. For me, it fails basic configuration steps on the simplest project. Plugin compatibility between VSCode and others seems iffy.

Couple this with Xcode 26.4 AI lacking agentic features and you get Swift programmers being left behind.