« BackExpanding Swift's IDE Supportswift.orgSubmitted by frizlab 2 days ago
  • rockbruno 2 days 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 a day ago

      I'm building iOS apps without opening Xcode. All in VSCode and CLI build tools. This is excellent!

      • jbverschoor 2 days ago

        Use swift as a scripting language without the slow start time:

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

        • frizlab a day ago

          Is “$0” (`argv[0]`) correct when the pre-compiled binary is launched instead of the script?

          • jbverschoor 20 hours 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 17 hours ago

              bash, zsh, and ksh93 support `exec -a` especially for this case.

        • jgbuddy 2 days ago

          This is huge, long time coming. Interested to see if there is SwiftUI support.

          • rockbruno 2 days 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 2 days ago

              You also can't do Android (app) development outside Android Studio.

              • Antonito 2 days 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 a day 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 2 days 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 2 days 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`).

                      • tadfisher 2 days ago

                        This is not an expectation, no. Libraries are managed via Gradle or whatever build system you use. Android-specific host tools are Gradle-managed, installed via the sdkmanager tool, or managed via other means; I maintain a repository to install them via Nix [0], and many Linux distributions package them. The Android Studio IDE is not required, and doing so would pretty much break everyone's CI setup.

                        [0]: https://github.com/tadfisher/android-nixpkgs

                        • daveoc64 2 days ago

                          They've always offered a bundle of the command line tools separately to Android Studio:

                          https://developer.android.com/studio#command-line-tools-only

                      • cyberax 2 days 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

                        • Terretta a day ago

                          On the contrary, commit your code to your GitHub repo, triggering Xcode cloud build to take it from there, build, test, deploy to TestFlight or store.

                          Found a bug while backpacking Sardinia? Edit the GitHub repo source on your phone, commit... hey, new build shipped.

                          See the App Store Connect mode: https://developer.apple.com/xcode-cloud/

                          • cyberax 20 hours ago

                            As I said, instead of providing tools, Apple locks you into a shitty GUI application. Thank you for giving another example.

                            • bigyabai 19 hours ago

                              > triggering Xcode cloud build

                              So my options are a 40gb compilation runtime, or a cloud build that bills me by the hour to avoid the 40gb compilation runtime.

                              You gotta hand it to Apple, any other audience would just call this "enshittification" and be done with it.

                            • manwe150 2 days ago

                              Just to nit pick a bit, that link is for Android Studio and downloads from the "Google for Developers" website, then instructs how to install and manage the the command line tools using the GUI

                              • thejazzman a day ago

                                Not trying to argue but you can indeed pretty much completely avoid Xcode at this point. I’ve been doing it the past few weeks, including pushing to my phone and AppStore connect

                                • Klonoar a day ago

                                  You can definitely avoid Xcode, what are you talking about?

                                  • cyberax 19 hours ago

                                    No, you can't. You'll need to hit "xcodebuild" somewhere in the chain. It's just that you can offload it to someone else (e.g. EAS Build) or use pre-built apps that only need JS/LUA/Python code package swapped.

                                • myko a day ago

                                  what? this is super easy with vim and gradle CLI

                                • QQ00 2 days ago

                                  What's the point then? Because nobody use Swift outside of iOS app development.

                                  • girvo 2 days ago

                                    > Because nobody use Swift outside of iOS app development

                                    Because that isn't true, people do use it outside of iOS app dev, and is becoming more true as time goes on to boot.

                                    It's also a chicken-and-egg problem: no one will use Swift for non-iOS tasks if the tooling support isn't there. The more investment into it, the more it will be picked up for other tasks.

                                    But it's been used outside of Apple-specific things since the early days in various niches.

                                    • myko a day ago

                                      I've been migrating my DikuMUD (originally C) to Swift for years! It's been pretty fun and Swift is a great language for it

                                  • hyzyla 2 days 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

                                    • sunnybeetroot 2 days ago

                                      Thanks for your great work on sweetpad. I’ve always been a bit curious where the name came from though.

                                      • wiseowise a day ago

                                        Sweet=sweeft=swift+pad?

                                    • nielsbot 2 days ago

                                      What type of support do you mean? Language checking? Live previews?

                                      • pezgrande a day 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 2 days 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.

                                        • tracymiranda 2 days ago

                                          Some recent fixes went into 6.2.3 which really help with C interop, this post shows what that looks like in practice https://www.swift.org/blog/improving-usability-of-c-librarie...

                                          • randomNumber7 a day ago

                                            These look mostly like toy examples where the type of the pointer can be inferred from the return values of the functions.

                                            How do I call this function in swift?

                                            SDL_AudioSpec* SDL_LoadWAV_RW(SDL_RWops * src, int freesrc, SDL_AudioSpec * spec, Uint8 * * audio_buf, Uint32 * audio_len);

                                          • frizlab 2 days ago

                                            yup, it got much better recently

                                          • jumploops 2 days ago

                                            Not to be that agentic coding guy, but I think this will become less of a problem than our historic biases suggest.

                                            For context, I just built a streaming markdown renderer in Swift because there wasn’t an existing open source package that met my needs, something that would have taken me weeks/months previously (I’m not a Swift dev).

                                            Porting all the C libraries you need isn’t necessarily an overnight task, but it’s no longer an insurmountable mountain in terms of dev time.

                                            • MattDamonSpace 2 days ago

                                              My favorite part is the AI will still estimate projects in human-time.

                                              “You’re looking at a multi-week refactor” aaaaand it’s done

                                              • nothinkjustai 2 days ago

                                                Yeah lol. “I estimate this will take 15-20 days” I do it in like 5 hours lol

                                              • randomNumber7 a day ago

                                                It's not necessary to rewrite perfectly fine libraries written by exceptional programmers. And whoever thinks it is an easy task (sorry rust guys) is severely suffering from the dunning-kruger effect.

                                                • buzzerbetrayed a day ago

                                                  Very high quality comment that is being downvoted unfairly because it defends AI. HN is on the wrong side of history on this one.

                                                  • inunuftbkj 20 hours ago

                                                    Nah. We’re right on the money with this one. AI is a nice tool to have available, but you AI nuts are the ones being voluntarily and gladly fed the whole “you’re a bazillion times more productive with our AI!!!!” marketing spiel.

                                                    It’s a nice tool, nothing more, nothing less. Anything else is marketing nonsense.

                                              • vyr 2 days 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

                                                • bartekpacia a day ago

                                                  The free Kotlin Multiplatorm plugin provides 1st class Swift support in IntelliJ IDEA. It’s heavily based on old AppCode codebase.

                                                  • pharaohgeek a day ago

                                                    As I understand it, though, it's really not well suited to server-side Swift development. Doesn't leverage SPM, requires Xcode, etc. I'd LOVE a revival of AppCode (or Swift support in CLion) that would facilitate server-side Swift development.

                                                • inatreecrown2 a day 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.

                                                  • frizlab a day ago

                                                    Little by little, Xcode is making progress. Probably a lot of the improvements come from the open-source and actual work on its build system… It’s still far from perfect, but at least it’s getting better.

                                                  • eptcyka a day ago

                                                    But can I develop iOS apps with vim? As in, easy to execute commands for debugging, running app and tests?

                                                    • micampe a day ago

                                                      If you’re willing to try Neovim I’ve been using xcodebuild.nvim for a couple of years (for macOS not iOS, but they’re both supported).

                                                      https://github.com/wojciech-kulik/xcodebuild.nvim

                                                      • fingerlocks a day ago

                                                        Yes, But an iOS app requires a helluva lot more than just the Swift language. For example, Metal has zero support so you have to use ft=cpp and disable lsp diagnostics. And you can completely forget Xcode’s wonderful Metal debugger entirely.

                                                        Otherwise swift works just like any other clang/llvm project and the tooling is basically the same.

                                                        • jadar 17 hours ago

                                                          Yes but most people are not dropping down to Metal support unless they're doing custom effects or developing a game engine. Most apps could be developed outside of Xcode just fine.

                                                          • fingerlocks 2 hours ago

                                                            Sometimes people add to the discussion by sharing esoteric knowledge because the uncommon aberrations are interesting.

                                                            That aside, there was a larger point I was making that was lost in the forest because you poking at a tree. iOS apps are more than Swift. Metal was one example, there are plenty of other tooling components that absolutely suck to use in vim, or just missing support entirely. Bundle management, plist files, custom build phases, code signing, asset previews, canvas previews, interface builder, profiling, and unit testing UI is a bunch of stuff that has nothing to do with swift, sucks in vim, and integral to application development.

                                                        • pjmlp a day ago

                                                          Yes, provided you are running vim on macOS, and calling into the xcode command line tooling.

                                                        • hbn 2 days 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.

                                                          • MaysonL 2 days 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.

                                                            • rafram 2 days ago

                                                              That is a very specific set of requirements. I doubt it.

                                                              • mckn1ght 2 days ago

                                                                If you could reimplement Emacs in Swift that’d be great

                                                              • castral 2 days ago

                                                                The loss of AppCode from Jetbrains was a huge blow to my motivation to continue working with Swift. Xcode just can't compare.

                                                                • pjmlp a day ago

                                                                  Apparently most folks were happy enough with XCode and didn't bother to buy AppCode licenses, hence why JetBrains gave up on it.

                                                                  • bmc7505 2 days ago

                                                                    I've recently been using this plugin [1], which is still under development but is an adequate stopgap until a better solution comes along.

                                                                    [1]: https://plugins.jetbrains.com/plugin/22150-noctule-the-swift...

                                                                  • aabhay 2 days ago

                                                                    We’ve used SweetPad and it worked fine for us, so this doesn’t change much.

                                                                    • wiseowise a day ago

                                                                      Everyone should post to open-vsx by default.

                                                                      • w10-1 a day 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.

                                                                        • inunuftbkj 20 hours ago

                                                                          > Couple this with Xcode 26.4 AI lacking agentic features

                                                                          A blessing, some might argue.

                                                                          • rescripting a day ago

                                                                            In what way does it fail?

                                                                            • w10-1 17 hours ago

                                                                              Package introspection fails with an error that there are other swiftpm processes running when there aren't in a clean project with no .folders - probably a race with itself. That means no automatic configuration for tests or executables, debugging, etc. Just "build all"