From 590b6f69bf2ce5308ae096b9734003fd9e8fba8d Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Wed, 17 Feb 2021 22:47:05 +0200 Subject: [PATCH] chore(dev): add debug config for vscode (#4756) * chore(dev): add debug config for vscode * chore(ide): move vscode configs to an example folder --- .gitignore | 1 + .vscode.example/launch.json | 19 +++++++++++++++ .../portainer.code-snippets | 23 ++----------------- 3 files changed, 22 insertions(+), 21 deletions(-) create mode 100644 .vscode.example/launch.json rename {.vscode => .vscode.example}/portainer.code-snippets (87%) diff --git a/.gitignore b/.gitignore index d0ac052cc..5714f964b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ api/cmd/portainer/portainer* **/.vscode/tasks.json .eslintcache +__debug_bin diff --git a/.vscode.example/launch.json b/.vscode.example/launch.json new file mode 100644 index 000000000..1d0e1fd51 --- /dev/null +++ b/.vscode.example/launch.json @@ -0,0 +1,19 @@ +{ + // 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": "Launch", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceRoot}/api/cmd/portainer/main.go", + "cwd": "${workspaceRoot}", + "env": {}, + "showLog": true, + "args": ["--data", "${env:HOME}/portainer-data", "--assets", "${workspaceRoot}/dist"] + } + ] +} diff --git a/.vscode/portainer.code-snippets b/.vscode.example/portainer.code-snippets similarity index 87% rename from .vscode/portainer.code-snippets rename to .vscode.example/portainer.code-snippets index 6f622dc6b..a638361db 100644 --- a/.vscode/portainer.code-snippets +++ b/.vscode.example/portainer.code-snippets @@ -21,11 +21,11 @@ "description": "Dummy Angularjs Component", "body": [ "import angular from 'angular';", - "import ${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}Controller from './${TM_FILENAME_BASE}Controller'", + "import controller from './${TM_FILENAME_BASE}Controller'", "", "angular.module('portainer.${TM_DIRECTORY/.*\\/app\\/([^\\/]*)(\\/.*)?$/$1/}').component('$TM_FILENAME_BASE', {", " templateUrl: './$TM_FILENAME_BASE.html',", - " controller: ${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}Controller,", + " controller,", "});", "" ] @@ -44,25 +44,6 @@ ], "description": "Dummy ES6+ controller" }, - "Model": { - "scope": "javascript", - "prefix": "mymodel", - "description": "Dummy ES6+ model", - "body": [ - "/**", - " * $1 Model", - " */", - "const _$1 = Object.freeze({", - " $0", - "});", - "", - "export class $1 {", - " constructor() {", - " Object.assign(this, JSON.parse(JSON.stringify(_$1)));", - " }", - "}" - ] - }, "Service": { "scope": "javascript", "prefix": "myservice",