From e3895b8a9504a7d275df6b1e7f65249941710121 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 1 Nov 2019 21:20:44 -0700 Subject: [PATCH] style: Add VSCode recommended launch and task configurations (#33544) This adds a common configurations used when developing code in VSCode. Specifically it adds support for launching these targets as tasks and ind debugger. - `packages/core/test` - `packages/core/test/render3` - `packages/core/test/acceptance` PR Close #33544 --- .gitignore | 1 + .vscode/README.md | 18 ++--- .vscode/recommended-launch.json | 85 ++++++++++++++++++++++++ .vscode/recommended-tasks.json | 113 ++++++++++++++++++++++++++++++++ 4 files changed, 209 insertions(+), 8 deletions(-) create mode 100644 .vscode/recommended-launch.json create mode 100644 .vscode/recommended-tasks.json diff --git a/.gitignore b/.gitignore index 91d2b4bbb9..64545b6943 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ pubspec.lock .settings/ .vscode/launch.json .vscode/settings.json +.vscode/tasks.json *.swo modules/.settings modules/.vscode diff --git a/.vscode/README.md b/.vscode/README.md index 25b5c495a7..8f43026628 100644 --- a/.vscode/README.md +++ b/.vscode/README.md @@ -1,23 +1,25 @@ # VSCode Configuration -This folder contains opt-in [Workspace Settings](https://code.visualstudio.com/docs/getstarted/settings) and [Extension Recommendations](https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions) that the Angular team recommends using when working on this repository. +This folder contains opt-in [Workspace Settings](https://code.visualstudio.com/docs/getstarted/settings), [Tasks](https://code.visualstudio.com/docs/editor/tasks), [Launch Configurations](https://code.visualstudio.com/Docs/editor/debugging#_launch-configurations) and [Extension Recommendations](https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions) that the Angular team recommends using when working on this repository. ## Usage -To use the recommended settings follow the steps below: +To use the recommended configurations follow the steps below: -- install -- copy `.vscode/recommended-settings.json` to `.vscode/settings.json` +- install the recommneded extensions in `.vscode/extensions.json` +- copy (or link) `.vscode/recommended-settings.json` to `.vscode/settings.json` +- copy (or link) `.vscode/recommended-launch.json` to `.vscode/launch.json` +- copy (or link) `.vscode/recommended-tasks.json` to `.vscode/tasks.json` - restart the editor -If you already have your custom workspace settings you should instead manually merge the file content. +If you already have your custom workspace settings you should instead manually merge the file contents. This isn't an automatic process so you will need to repeat it when settings are updated. To see the recommended extensions select "Extensions: Show Recommended Extensions" in the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette). -## Editing `.vscode/recommended-settings.json` +## Editing `.vscode/recommended-*.json` files -If you wish to add extra configuration items please keep in mind any settings you add here will be used by many users. +If you wish to add extra configuration items please keep in mind any modifications you make here will be used by many users. -Try to keep these settings to things that help facilitate the development process and avoid altering the user workflow whenever possible. +Try to keep these settings/configuations to things that help facilitate the development process and avoid altering the user workflow whenever possible. diff --git a/.vscode/recommended-launch.json b/.vscode/recommended-launch.json new file mode 100644 index 0000000000..e344ab64a5 --- /dev/null +++ b/.vscode/recommended-launch.json @@ -0,0 +1,85 @@ +{ + // 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": "Attach to bazel test ... --config=debug", + "type": "node", + "request": "attach", + "port": 9229, + "address": "localhost", + "restart": false, + "sourceMaps": true, + "localRoot": "${workspaceRoot}", + "remoteRoot": "${workspaceRoot}", + "stopOnEntry": false, + "timeout": 60000, + }, + { + "name": "Attach to bazel test ... --config=debug (no source maps)", + "type": "node", + "request": "attach", + "port": 9229, + "address": "localhost", + "restart": false, + "sourceMaps": false, + "localRoot": "${workspaceRoot}", + "remoteRoot": "${workspaceRoot}", + "stopOnEntry": false, + "timeout": 60000, + }, + { + "name": "IVY:packages/core/test/acceptance", + "type": "node", + "request": "launch", + "program": "${workspaceFolder}/node_modules/.bin/bazel", + "args": [ + "test", + "--define=compile=aot", + "packages/core/test/acceptance", + "--config=debug" + ], + "port": 9229, + "address": "localhost", + "restart": true, + "sourceMaps": true, + "timeout": 60000, + }, + { + "name": "IVY:packages/core/test/render3", + "type": "node", + "request": "launch", + "program": "${workspaceFolder}/node_modules/.bin/bazel", + "args": [ + "test", + "--define=compile=aot", + "packages/core/test/render3", + "--config=debug" + ], + "port": 9229, + "address": "localhost", + "restart": true, + "sourceMaps": true, + "timeout": 60000, + }, + { + "name": "IVY:packages/core/test", + "type": "node", + "request": "launch", + "program": "${workspaceFolder}/node_modules/.bin/bazel", + "args": [ + "test", + "--define=compile=aot", + "packages/core/test", + "--config=debug" + ], + "port": 9229, + "address": "localhost", + "restart": true, + "sourceMaps": true, + "timeout": 60000, + }, + ] +} diff --git a/.vscode/recommended-tasks.json b/.vscode/recommended-tasks.json new file mode 100644 index 0000000000..4803007684 --- /dev/null +++ b/.vscode/recommended-tasks.json @@ -0,0 +1,113 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "IVY:packages/core/test/...", + "type": "shell", + "command": "${workspaceFolder}/node_modules/.bin/bazel", + "args": [ + "test", + "--define=compile=aot", + "packages/core/test", + "packages/core/test/acceptance", + "packages/core/test/render3", + ], + "group": "test", + "presentation": { + "reveal": "always", + "panel": "dedicated", + }, + }, + { + "label": "VE:packages/core/test/...", + "type": "shell", + "command": "${workspaceFolder}/node_modules/.bin/bazel", + "args": [ + "test", + "packages/core/test", + "packages/core/test/acceptance", + "packages/core/test/render3", + ], + "group": "test", + "presentation": { + "reveal": "always", + "panel": "dedicated", + }, + }, + { + "label": "IVY:packages/core/test/acceptance", + "type": "shell", + "command": "${workspaceFolder}/node_modules/.bin/bazel", + "args": [ + "test", + "--define=compile=aot", + "packages/core/test/acceptance", + ], + "group": "test", + "presentation": { + "reveal": "always", + "panel": "dedicated", + }, + }, + { + "label": "VE:packages/core/test/acceptance", + "type": "shell", + "command": "${workspaceFolder}/node_modules/.bin/bazel", + "args": [ + "test", + "packages/core/test/acceptance", + ], + "group": "test", + "presentation": { + "reveal": "always", + "panel": "dedicated", + }, + }, + { + "label": "IVY:packages/core/test", + "type": "shell", + "command": "${workspaceFolder}/node_modules/.bin/bazel", + "args": [ + "test", + "--define=compile=aot", + "packages/core/test", + ], + "group": "test", + "presentation": { + "reveal": "always", + "panel": "dedicated", + }, + }, + { + "label": "VE:packages/core/test", + "type": "shell", + "command": "${workspaceFolder}/node_modules/.bin/bazel", + "args": [ + "test", + "packages/core/test", + ], + "group": "test", + "presentation": { + "reveal": "always", + "panel": "dedicated", + }, + }, + { + "label": "IVY:packages/core/test/render3", + "type": "shell", + "command": "${workspaceFolder}/node_modules/.bin/bazel", + "args": [ + "test", + "--define=compile=aot", + "packages/core/test/render3", + ], + "group": "test", + "presentation": { + "reveal": "always", + "panel": "dedicated", + }, + }, + ], +}