From 5022abd4fa46282d473851384f76bb5b3212d815 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 27 Nov 2018 12:36:19 -0800 Subject: [PATCH 1/2] Fix debugging with VS Code Insiders and other Lint fixes. --- Extension/.vscode/launch.json | 4 +- Extension/.vscode/tasks.json | 4 +- Extension/package-lock.json | 5 +++ Extension/package.json | 1 + .../debug.integration.test.ts | 12 +++--- .../SimpleCppProject/.vscode/tasks.json | 38 ++++++++++++++----- Extension/tools/OptionsSchema.json | 8 +++- 7 files changed, 49 insertions(+), 23 deletions(-) diff --git a/Extension/.vscode/launch.json b/Extension/.vscode/launch.json index 022eaed81..8aafc7dee 100644 --- a/Extension/.vscode/launch.json +++ b/Extension/.vscode/launch.json @@ -15,7 +15,7 @@ "outFiles": [ "${workspaceFolder}/out/**/*.js" ], - "preLaunchTask": "compile", + "preLaunchTask": "TypeScript Compile", }, { "name": "Launch Tests", @@ -31,7 +31,7 @@ "outFiles": [ "${workspaceFolder}/out/test/**/*.js" ], - "preLaunchTask": "compile" + "preLaunchTask": "TypeScript Compile" }, { "name": "Node Attach", diff --git a/Extension/.vscode/tasks.json b/Extension/.vscode/tasks.json index bcf550385..13b233108 100644 --- a/Extension/.vscode/tasks.json +++ b/Extension/.vscode/tasks.json @@ -5,7 +5,6 @@ "tasks": [ { "label": "TypeScript Compile", - "identifier": "compile", "group": { "kind": "build", "isDefault": true @@ -29,7 +28,6 @@ }, { "label": "TypeScript Lint", - "identifier": "tslint", "group": "build", "isBackground": false, "type": "shell", @@ -53,7 +51,7 @@ ] }, "dependsOn": [ - "compile" + "TypeScript Compile" ] } ] diff --git a/Extension/package-lock.json b/Extension/package-lock.json index ae974ff42..e42f5f1db 100644 --- a/Extension/package-lock.json +++ b/Extension/package-lock.json @@ -4,6 +4,11 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" + }, "@types/mocha": { "version": "2.2.45", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.45.tgz", diff --git a/Extension/package.json b/Extension/package.json index c18a5b5da..381e721df 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -1407,6 +1407,7 @@ "vscode": "^1.1.18" }, "dependencies": { + "@types/minimatch": "^3.0.3", "http-proxy-agent": "~2.1.0", "https-proxy-agent": "~2.2.0", "jsonc-parser": "^1.0.0", diff --git a/Extension/test/integrationTests/debug.integration.test.ts b/Extension/test/integrationTests/debug.integration.test.ts index 12b7b7580..434e35fd7 100644 --- a/Extension/test/integrationTests/debug.integration.test.ts +++ b/Extension/test/integrationTests/debug.integration.test.ts @@ -6,10 +6,10 @@ import * as vscode from 'vscode'; import * as assert from 'assert'; -suite(`Debug Integration Test: `, function() { - suiteSetup(async function() { - let extension = vscode.extensions.getExtension("ms-vscode.cpptools"); - if (!extension.isActive) { +suite(`Debug Integration Test: `, function(): void { + suiteSetup(async function(): Promise { + let extension: vscode.Extension = vscode.extensions.getExtension("ms-vscode.cpptools"); + if (!extension.isActive) { await extension.activate(); } }); @@ -17,14 +17,14 @@ suite(`Debug Integration Test: `, function() { test("Starting (gdb) Launch from the workspace root should create an Active Debug Session", async () => { await vscode.debug.startDebugging(vscode.workspace.workspaceFolders[0], "(gdb) Launch"); - let debugSessionTerminated = new Promise(resolve => { + let debugSessionTerminated: Promise = new Promise(resolve => { vscode.debug.onDidTerminateDebugSession((e) => resolve()); }); try { assert.equal(vscode.debug.activeDebugSession.type, "cppdbg"); } catch (e) { - assert.fail("Debugger failed to launch. Did the extension activate correctly?") + assert.fail("Debugger failed to launch. Did the extension activate correctly?"); } await debugSessionTerminated; diff --git a/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json b/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json index 2aeffb640..8e8fecc02 100644 --- a/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json +++ b/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json @@ -1,16 +1,34 @@ { - "version": "0.1.0", + "version": "2.0.0", "tasks": [ { - "taskName": "build", - "command": "g++", - "isShellCommand": true, - "args": ["main.cpp", "-g", "-o", "program"], - "showOutput": "always", - "isBuildCommand": true, - "windows": { - "command": "C:\\MinGW\\bin\\g++.exe" - } + "label": "build", + "command": "g++", + "type": "shell", + "args": [ + "main.cpp", + "-g", + "-o", + "program" + ], + "group":{ + "kind": "build", + "isDefault": true + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + }, + "windows": { + "command": "F:\\MinGW\\bin\\g++.exe" + }, + "problemMatcher": [ + "$gcc" + ] } ] } \ No newline at end of file diff --git a/Extension/tools/OptionsSchema.json b/Extension/tools/OptionsSchema.json index 5b2721028..07163c717 100644 --- a/Extension/tools/OptionsSchema.json +++ b/Extension/tools/OptionsSchema.json @@ -110,8 +110,12 @@ "type": "object", "default": {}, "properties": { - "name": "string", - "value": "string" + "name": { + "type": "string" + }, + "value": { + "type": "string" + } } }, "CppdbgLaunchOptions": { From 09cd7e2eef21da3eed3abbca5403b530a2fa995b Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 27 Nov 2018 12:38:11 -0800 Subject: [PATCH 2/2] Fix. --- .../testAssets/SimpleCppProject/.vscode/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json b/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json index 8e8fecc02..a25a78b19 100644 --- a/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json +++ b/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json @@ -24,7 +24,7 @@ "clear": false }, "windows": { - "command": "F:\\MinGW\\bin\\g++.exe" + "command": "C:\\MinGW\\bin\\g++.exe" }, "problemMatcher": [ "$gcc"