Introducing Swift for Visual Studio Code

Hi all,

Here’s a Christmas present for those of you who prefer (or have to) develop Swift packages outside of Xcode - today we’re releasing the initial version of the VSCode Swift extension :tada:

You can find the initial 0.1.0 release on the Visual Studio Marketplace here.

The extension aims to provide a first-class experience for developing Swift packages in VSCode. It’s being guided by the SSWG but a huge shoutout goes to @svanimpe and @adam-fowler who have done all of the work to get it ready for an initial release! One of the goals for 2021 for the SSWG was to improve the tooling for Swift on the server and this fills an important part of that.

The highlights of the extension include:

  • Automatic task creation
  • Package dependency view
  • Code completion
  • Jump to definition, peek definition, find all references, symbol search
  • Error annotations and apply suggestions from errors
  • Automatic generation of launch configurations for debugging with CoreLLDB

I’ve been using it for a couple of weeks now to work on some Vapor projects and it’s been great.

It would be remiss not to mention the extensions that have inspired this work, especially the Maintained Swift Development Environment. It would have been awesome to integrate them but proved too difficult in the end with differing aims.

Please note that this is a 0.1.0 release so it is not feature complete and there will be bugs that need to be fixed. We hope that lots of people will try it out and get involved!

Future Aims

Over the next couple of weeks I’ll be working to integrate the VSCode test explorer to provide a similar test experience to Xcode (run individual tests or classes of tests from the UI) and I’m sure there will be many feature requests and bugs to fix! Please create an issue on the GitHub repo or post on the #vscode-swift channel on Slack.

Any contributions would be amazing and this is a community driven extension so if you want to get involved, please do!

206 Likes

Thank you Santa !

11 Likes

Thank you all so much for your hard work on this!!! Super excited to try it out

5 Likes

And arrived on the same day as my M1 MBP. Thanks!

3 Likes

Fantastic work! I’m super excited about this and pushing the developer experience in other editors :heart: :heart: :heart:

9 Likes

Whoa awesome :fire::heart_eyes:

2 Likes

Thank you to all for the great work.

2 Likes

Thank you guys! :gift::christmas_tree:

2 Likes

This is awesome! Can’t wait to give it a try!

While @0xTim is working on the test explorer I am hoping to be improving the multi-project workspace support and enabling local editing of swift package dependencies.

10 Likes

thank you Tim! Amazing work! Is it working even on Windows?

Yes it works on Windows, thanks to @svanimpe. There are some issues with debug symbols I believe but @svanimpe will be able to give more details on that.

6 Likes

Is there a way to join the Swift Server Slack? It seems this link is not accepting new users.

Here's an invite link that shouldn't expire

Maybe should create a new VSCode category under this forum for better focus on Swift for VSCode announcement/updates and discussions.

1 Like

Already requested, will take a while I imagine as everyone is having a well deserved holiday break

1 Like

This is really really great. I'm teaching underprivileged kids in my neighbourhood how to code Swift, but since they don't have Macs I'm using GitHub Codespaces with VSCode – this is going to make their learning experience so, so much better. Thanks a lot to the whole team!

22 Likes

Soon, they might be able to use Google Colab as well.

This is really great. I installed it on a Raspberry Pi, and was building and remote-debugging from my Mac instantly. It's the first time I've managed to get LLDB working with Swift on Linux (I know it was possible before, but nowhere near this easy to set up).

A big thanks to everybody who worked on this.

It's amazing to think how far Swift tooling has come over the last 12 months - first DocC, now this. It's nice. We're in a much better place.

14 Likes

Super awesome!

Any plan to support UIKit and AppKit?

2 Likes