在 VSCode 中运行 Swift 程序,需要在项目目录中创建一个名为 tasks.json
的文件,并在其中配置编译和运行任务。
以下是一个示例 tasks.json
配置:
{
"version": "2.0.0",
"tasks": [
{
"label": "Build and run",
"type": "shell",
"command": "swift",
"args": [
"build",