From befdfedfb62d66a9f8b40e7bce83b5a28b1c95ef Mon Sep 17 00:00:00 2001 From: Raymond Chen Date: Thu, 19 Aug 2021 06:08:43 -0400 Subject: [PATCH] Add documentation for setting up debugging in VSCode (#29987) --- devenv/README.md | 3 +++ devenv/vscode/launch.json | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 devenv/vscode/launch.json diff --git a/devenv/README.md b/devenv/README.md index 000d5463914..7633afe7906 100644 --- a/devenv/README.md +++ b/devenv/README.md @@ -55,6 +55,9 @@ Jaeger block runs both Jaeger and Loki container. Loki container sends traces to | 1.0 | graphite1 | 8280 | 2203 | 2203 | | 0.9 | graphite09 | 8380 | 2303 | 2303 | +## Debugging setup in VS Code +An example of launch.json is provided in `devenv/vscode/launch.json`. It basically does what Makefile and .bra.toml do. The 'program' field is set to the folder name so VS Code loads all *.go files in it instead of just main.go. + ## Troubleshooting ### Containers that read from log files fail to start (Mac OS) diff --git a/devenv/vscode/launch.json b/devenv/vscode/launch.json new file mode 100644 index 00000000000..d988713128a --- /dev/null +++ b/devenv/vscode/launch.json @@ -0,0 +1,21 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "grafana-server", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/pkg/cmd/grafana-server", + "env": {}, + "args": [ + "--homepath=${workspaceFolder}", + "--packaging=dev", + "cfg:app_mode=development", + ] + } + ] +} \ No newline at end of file