Broader Frontends
Author : Kazuhiro Hara
Article permalink

Setting up a Vapor coding environment in VSCode on Windows

When running Vapor on Windows, WSL is essential. That means VSCode will also use files on WSL as the development environment.

Assuming VSCode is already set up, what you need is language-related support and a formatter. For language support, there is an extension simply named Swift, so I gratefully use it.

Swift VSCode extension

For the formatter, I gratefully used an extension called apple-swift-format.

Extension for using the Swift formatter

After installing it, an alert appears if swift-format is not installed. So it needs to be installed, and I quickly installed it globally.

$ brew install swift-format

After that, the alert disappeared, and I could format code in a way similar to Prettier.

In a WSL and VSCode environment, Swift coding feels very smooth and comfortable. For some reason Xcode feels sluggish on my Mac mini, so I am starting to think I might use VSCode even on the Mac.

SwiftVaporVSCode

Share