swift + vs code + wsl

windows(wsl) + swiftせっとあっぷ - うおおお

wsl + swift はいれとく

vs code と wsl の連携

Remote - WSL - Visual Studio Marketplace
vs code に入れる

f:id:gamaspecial:20200701021948p:plain

したら「><」おして

f:id:gamaspecial:20200701022053p:plain

「Remote-WSL: New Window」

f:id:gamaspecial:20200701022204p:plain

したらつながる

f:id:gamaspecial:20200701022258p:plain

code ファイル名

wslから vs code ひらけるようになる

f:id:gamaspecial:20200701022537p:plain

vs code に swift 拡張機能いれる

Maintained Swift Development Environment - Visual Studio Marketplace

remote のほうでね

f:id:gamaspecial:20200701023148p:plain

したら設定なんだが、

SDE 設定

  • Swift : Path: Swift_driver_bin => ${swift いれたとこ}/bin/swift

  • Sde: Language Server Mode => sourcekit-lsp

  • Sourcekit-lsp: Server Path => ${swift いれたとこ}/bin/sourcekit-lsp

いちおうここからおとせるけど、swift入れたときになんか中に入ってたのでそれつかってみる。
github.com

server mode は任意で
f:id:gamaspecial:20200701234319p:plain

やる

build と run
f:id:gamaspecial:20200701234754p:plain

よいのでは

f:id:gamaspecial:20200702002338p:plain