From a3d9e3c927f643905cda05cfbd04bd32e3af29ea Mon Sep 17 00:00:00 2001 From: as-iotex Date: Tue, 15 Mar 2022 08:35:01 +0000 Subject: [PATCH] chore: VSCode enhancements --- .devcontainer/devcontainer.json | 4 +++- .vscode/launch.json | 34 ++++++++++++++++++++++++++++----- .vscode/tasks.json | 15 ++++++++++++++- 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a8b95c7..e9634fc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,7 +21,9 @@ "twxs.cmake", "eamodio.gitlens", "zxh404.vscode-proto3", - "ms-azuretools.vscode-docker" + "ms-azuretools.vscode-docker", + "ms-python.python", + "eriklynd.json-tools" ], "containerEnv": { diff --git a/.vscode/launch.json b/.vscode/launch.json index c382990..1f65b4c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,11 +2,38 @@ "version": "0.2.0", "configurations": [ { - "name": "Unit tests - launch", + "name": "Unit tests: launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/build/tests/iotex_unit_tests", - // "args": [ "--gtest_filter=\"*.Transaction*\""], + "args": [ + // "--gtest_filter=\"*.ReadContract*\"" + ], + "cwd": "${workspaceFolder}", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": false + }, + { + "description": "Enable all-exceptions", + "text": "catch throw", + "ignoreFailures": true + } + ], + "stopAtEntry": false + }, + { + "name": "Unit tests: rebuild and launch", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/tests/iotex_unit_tests", + "args": [ + // "--gtest_filter=\"*.ReadContract*\"" + ], "cwd": "${workspaceFolder}", "MIMode": "gdb", "miDebuggerPath": "gdb", @@ -24,9 +51,6 @@ } ], "stopAtEntry": false, - // "sourceFileMap": { - // // "lookedSource": "actualSource" - // } }, { "name": "Server fake: launch", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 728562c..0432ef1 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,7 +4,7 @@ { "type": "shell", "label": "Arduino: Build unit tests", - "command": "cd ${workspaceRoot}/build && cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ../ && make -j 6", + "command": "cd ${workspaceRoot}/build && cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ../ && make", "options": { "cwd": "${workspaceRoot}/" }, @@ -46,6 +46,19 @@ "problemMatcher": [ "$gcc" ], + "dependsOn": [ "Http-grpc server: generate protobufs" ], + "dependsOrder": "sequence" + }, + { + "type": "shell", + "label": "Http-grpc server: restart", + "command": "killall envoy && envoy -c envoy-conf.yaml", + "options": { + "cwd": "${workspaceRoot}/tools/server" + }, + "problemMatcher": [ + "$gcc" + ], "dependsOn": [], "dependsOrder": "sequence" },