diff --git a/.gitignore b/.gitignore index 86f344eda49..b5a7c0e59e3 100644 --- a/.gitignore +++ b/.gitignore @@ -61,9 +61,10 @@ internal/ **/.DS_Store .settings **/.vs -**/.vscode +**/.vscode/* !**/.vscode/tasks.json -!**/.vscode/settings.json +!**/.vscode/settings.template.json +!**/.vscode/launch.template.json !**/.vscode/extensions.json !tests/cases/projects/projectOption/**/node_modules !tests/cases/projects/NodeModulesSearch/**/* diff --git a/.vscode/launch.template.json b/.vscode/launch.template.json new file mode 100644 index 00000000000..4ba7f8ab880 --- /dev/null +++ b/.vscode/launch.template.json @@ -0,0 +1,39 @@ +// Rename this file 'launch.json' or merge its +// contents into your existing configurations. +{ + // 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": [ + { + "type": "node", + "protocol": "inspector", + "request": "launch", + "name": "Mocha Tests (currently opened test)", + "runtimeArgs": ["--nolazy"], + "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", + "args": [ + "-u", + "bdd", + "--no-timeouts", + "--colors", + "built/local/run.js", + "-f", + "${fileBasenameNoExtension}", + "--skip-percent", + "0" + ], + "env": { + "NODE_ENV": "testing" + }, + "sourceMaps": true, + "smartStep": true, + "preLaunchTask": "tests", + "console": "integratedTerminal", + "outFiles": [ + "${workspaceRoot}/built/local/run.js" + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 14f7984e7e9..00000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "eslint.validate": [ - { - "language": "typescript", - "autoFix": true - } - ], - "eslint.options": { - "rulePaths": ["./scripts/eslint/built/rules/"], - "ext": [".ts"] - } -} \ No newline at end of file diff --git a/.vscode/settings.template.json b/.vscode/settings.template.json new file mode 100644 index 00000000000..1806a93ecbc --- /dev/null +++ b/.vscode/settings.template.json @@ -0,0 +1,19 @@ +// Rename this file 'settings.json' or merge its +// contents into your existing settings. +{ + "eslint.validate": [ + { + "language": "typescript", + "autoFix": true + } + ], + "eslint.options": { + "rulePaths": ["./scripts/eslint/built/rules/"], + "ext": [".ts"] + }, + // To use the last-known-good (LKG) compiler version: + // "typescript.tsdk": "lib" + + // To use the locally built compiler, after 'npm run build': + // "typescript.tsdk": "built/local" +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b804414ab5..dda3ab28a7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -160,6 +160,8 @@ You can debug with VS Code or Node instead with `gulp runtests --inspect=true`: gulp runtests --tests=2dArrays --inspect=true ``` +You can also use the [provided VS Code launch configuration](./.vscode/launch.template.json) to launch a debug session for an open test file. Rename the file 'launch.json', open the test file of interest, and launch the debugger from the debug panel (or press F5). + ## Adding a Test To add a new test case, simply place a `.ts` file in `tests\cases\compiler` containing code that exemplifies the bugfix or change you are making.