Skip to content

Commit

Permalink
Allow F5 debugging with args specified at launch time (Azure#2629)
Browse files Browse the repository at this point in the history
Update launch.json to allow F5 debugging with program arguments specified at launch time. This uses a new feature shipped with the 0.39.0 release of VSCode Go extension.
  • Loading branch information
weikanglim authored Aug 14, 2023
1 parent 17d332f commit 24655c0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
22 changes: 21 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,32 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
// If you set `AZD_DEBUG=true` in your environment, `azd` will pause early in start up and allow you to attach
// to it. Use the Attach to Process configuration and pick the corresponding `azd` process.
{
"name": "Attach to Process",
"type": "go",
"request": "attach",
"mode": "local",
"processId": "${command:pickGoProcess}"
},
// This will launch azd cli (starting from cli/azd/main.go), under the debugger.
{
"name": "Debug azd cli",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/cli/azd",
"args": "${input:cliArgs}",
"console": "integratedTerminal",
}
],
"inputs": [
{
"id": "cliArgs",
"type": "promptString",
"description": "Args for launching azd cli. Use --cwd to set the working directory.",
"default": "auth login --use-device-code"
}
]
}
}
26 changes: 11 additions & 15 deletions cli/azd/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,23 @@
"processId": "${command:pickGoProcess}"
},
// This will launch azd (starting from main.go), under the debugger.
{
"name": "Launch `azd`",
"type": "go",
"request": "launch",
"program": "${workspaceFolder}",

// Uncomment these settings to control how `azd` is launched.
// "cwd": "${workspaceFolder}",
// "args": ["provision"]
},
{
"name": "dev-azd (launch)",
"name": "Debug azd cli",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}",
"args": [
"auth", "login"
],
"cwd": "${workspaceFolder}",
"args": "${input:cliArgs}",
"console": "integratedTerminal",
}
],
"inputs": [
{
"id": "cliArgs",
"type": "promptString",
"description": "Args for launching azd cli. Use --cwd to set the working directory.",
"default": "auth login --use-device-code"
}
]
}
}

0 comments on commit 24655c0

Please sign in to comment.