From 525df82a50723f18eb891cd5a83d1f913123ad84 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Mon, 20 Mar 2023 19:00:46 +0800 Subject: [PATCH] add .vscode simple launch config for debug paopao-ce --- .gitignore | 2 +- .vscode/.gitignore | 3 +++ .vscode/launch.json | 17 +++++++++++++++++ .vscode/sort_launch.js | 4 ++++ .vscode/tasks.json | 21 +++++++++++++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .vscode/.gitignore create mode 100644 .vscode/launch.json create mode 100644 .vscode/sort_launch.js create mode 100644 .vscode/tasks.json diff --git a/.gitignore b/.gitignore index 6cef1340..96f9f38d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .DS_Store .idea -.vscode +__debug_bin !*.example /config.yaml *.log diff --git a/.vscode/.gitignore b/.vscode/.gitignore new file mode 100644 index 00000000..945fe607 --- /dev/null +++ b/.vscode/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +*.log +__debug_bin diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..8919009c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // 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": "paopao-ce [debug]", + "type": "go", + "request": "launch", + "mode": "exec", + "program": "${fileDirname}/__debug_bin", + "preLaunchTask": "go: build (debug)", + "cwd": "${workspaceFolder}" + } + ] +} diff --git a/.vscode/sort_launch.js b/.vscode/sort_launch.js new file mode 100644 index 00000000..58d379e3 --- /dev/null +++ b/.vscode/sort_launch.js @@ -0,0 +1,4 @@ +let launch = require('./launch.json'); +launch.configurations.sort((a, b) => a.name.localeCompare(b.name)); +let fs = require('fs'); +fs.writeFileSync('launch.json', JSON.stringify(launch, null, 4)); diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..b716d1a8 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,21 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "go: build (debug)", + "type": "shell", + "command": "go", + "args": [ + "build", + "-gcflags=all=-N -l", + "-tags", + "'embed go_json'", + "-o", + "${workspaceFolder}/.vscode/__debug_bin" + ], + "options": { + "cwd": "${workspaceFolder}" + } + } + ] +}