From dbd2bcfe054a4501d8f45a6b85d1b8506635a704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20D=C3=B6ll?= Date: Wed, 29 May 2024 13:59:43 +0000 Subject: [PATCH] chore: add vscode debug config --- .vscode/launch.json | 13 +++++++++++++ .vscode/tasks.json | 17 +++++++++++++++++ cmd/api/.air.toml | 9 +++++++++ cmd/web/.air.toml | 9 +++++++++ 4 files changed, 48 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..bcf5100b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Attach to Air", + "type": "go", + "mode": "remote", + "request": "attach", + "host": "127.0.0.1", + "port": 2345 + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..054d3857 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Start Web Server", + "type": "shell", + "command": "air", + "args": ["-c", "${workspaceFolder}/cmd/web/.air.toml"] + }, + { + "label": "Start API Server", + "type": "shell", + "command": "air", + "args": ["-c", "${workspaceFolder}/cmd/api/.air.toml"] + } + ] + } \ No newline at end of file diff --git a/cmd/api/.air.toml b/cmd/api/.air.toml index 5cea0559..bc1bee6c 100644 --- a/cmd/api/.air.toml +++ b/cmd/api/.air.toml @@ -1,10 +1,19 @@ # .air.toml root = "." tmp_dir = "tmp" + [build] cmd = "go build -o ./tmp/api cmd/api/main.go" bin = "./tmp/api" + full_bin = "dlv exec ./tmp/api --listen=127.0.0.1:2345 --headless=true --api-version=2 --accept-multiclient --continue --log -- " delay = 1000 # ms exclude_dir = ["assets", "tmp", "vendor"] include_ext = ["go", "tpl", "tmpl", "html"] exclude_regex = ["_test\\.go"] + +[misc] + clean_on_exit = true + +[screen] + clear_on_rebuild = true + keep_scroll = true \ No newline at end of file diff --git a/cmd/web/.air.toml b/cmd/web/.air.toml index bafb2c49..41efeecd 100644 --- a/cmd/web/.air.toml +++ b/cmd/web/.air.toml @@ -1,10 +1,19 @@ # .air.toml root = "." tmp_dir = "tmp" + [build] cmd = "go build -o ./tmp/web cmd/web/main.go" bin = "./tmp/web" + full_bin = "dlv exec ./tmp/web --listen=127.0.0.1:2345 --headless=true --api-version=2 --accept-multiclient --continue --log -- " delay = 1000 # ms exclude_dir = ["assets", "tmp", "vendor"] include_ext = ["go", "tpl", "tmpl", "html"] exclude_regex = ["_test\\.go"] + +[misc] + clean_on_exit = true + +[screen] + clear_on_rebuild = true + keep_scroll = true \ No newline at end of file