From 7754743a7e0860d8b8e0096ef544a72371695c1d Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 25 Nov 2015 10:58:13 +0100 Subject: [PATCH] api tests: allow to run and debug them --- extensions/tsconfig.json | 3 +- .../vscode-api-tests/.vscode/launch.json | 17 +++++++++++ .../vscode-api-tests/.vscode/tasks.json | 30 +++++++++++++++++++ extensions/vscode-api-tests/package.json | 2 ++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 extensions/vscode-api-tests/.vscode/launch.json create mode 100644 extensions/vscode-api-tests/.vscode/tasks.json diff --git a/extensions/tsconfig.json b/extensions/tsconfig.json index 36f6ef5e85c..379cfd01b07 100644 --- a/extensions/tsconfig.json +++ b/extensions/tsconfig.json @@ -11,6 +11,7 @@ "typescript/src/lib", "typescript/out/lib", "jshint", - "csharp-o" + "csharp-o", + "vscode-api-tests/node_modules" ] } \ No newline at end of file diff --git a/extensions/vscode-api-tests/.vscode/launch.json b/extensions/vscode-api-tests/.vscode/launch.json new file mode 100644 index 00000000000..b6ed0f7a674 --- /dev/null +++ b/extensions/vscode-api-tests/.vscode/launch.json @@ -0,0 +1,17 @@ +// A launch configuration that compiles the extension and then opens it inside a new window +{ + "version": "0.1.0", + "configurations": [ + { + "name": "Launch Tests", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["${workspaceRoot}/../../", "${workspaceRoot}/testWorkspace", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out" ], + "stopOnEntry": false, + "sourceMaps": true, + "outDir": "out", + "preLaunchTask": "npm" + } + ] +} \ No newline at end of file diff --git a/extensions/vscode-api-tests/.vscode/tasks.json b/extensions/vscode-api-tests/.vscode/tasks.json new file mode 100644 index 00000000000..d31b15910ee --- /dev/null +++ b/extensions/vscode-api-tests/.vscode/tasks.json @@ -0,0 +1,30 @@ +// Available variables which can be used inside of strings. +// ${workspaceRoot}: the root folder of the team +// ${file}: the current opened file +// ${fileBasename}: the current opened file's basename +// ${fileDirname}: the current opened file's dirname +// ${fileExtname}: the current opened file's extension +// ${cwd}: the current working directory of the spawned process + +// A task runner that calls a custom npm script that compiles the extension. +{ + "version": "0.1.0", + + // we want to run npm + "command": "npm", + + // the command is a shell script + "isShellCommand": true, + + // show the output window only if unrecognized errors occur. + "showOutput": "silent", + + // we run the custom script "compile" as defined in package.json + "args": ["run", "compile", "--loglevel", "silent"], + + // The tsc compiler is started in watching mode + "isWatching": true, + + // use the standard tsc in watch mode problem matcher to find compile problems in the output. + "problemMatcher": "$tsc-watch" +} \ No newline at end of file diff --git a/extensions/vscode-api-tests/package.json b/extensions/vscode-api-tests/package.json index 20e6ba7de8d..8b6055b5822 100644 --- a/extensions/vscode-api-tests/package.json +++ b/extensions/vscode-api-tests/package.json @@ -8,9 +8,11 @@ "vscode": "*" }, "scripts": { + "compile": "node ./node_modules/vscode/bin/compile -watch -p ./", "vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../gulpfile.plugins.js compile-plugin:vscode-api-tests ./tsconfig.json" }, "devDependencies": { + "typescript": "^1.6.2", "vscode": "next" } } \ No newline at end of file