From f0ae85a8c8b0289d2ad3fac66da781823adde481 Mon Sep 17 00:00:00 2001 From: Anatoliy Bazko Date: Tue, 9 Jul 2019 03:20:17 +0300 Subject: [PATCH] Add onDebug activate event --- .gitignore | 11 +++++++++++ package.json | 5 ++++- src/extension.ts | 8 +++----- 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8ad6cf0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +.DS_Store +node_modules +build +lib +*.log +.idea +.metadata +*.iml +.Trash-* +out +adapter \ No newline at end of file diff --git a/package.json b/package.json index 6d04e0d..4f4c0cb 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,9 @@ "tslint": "^5.12.1", "vscode-test": "^1.0.0-next.0" }, + "activationEvents": [ + "onDebug" + ], "contributes": { "debuggers": [ { @@ -66,7 +69,7 @@ "label": "Pig Debug: Launch", "description": "A new configuration for launching a Pig debug", "body": { - "type": "pig", + "type": "pig-debug", "request": "launch", "name": "Debugging a pig file", "stopOnEntry": true, diff --git a/src/extension.ts b/src/extension.ts index 4897b58..2bd58d4 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,14 +1,12 @@ -// The module 'vscode' contains the VS Code extensibility API +// The module 'vscode' contains the VS Code extsensibility API // Import the module and reference it with the alias vscode in your code below import * as path from 'path'; import * as vscode from 'vscode'; import { DebugConfigurationProvider, PIG_DEBUG } from './debug-configuration-provider'; export function activate(context: vscode.ExtensionContext) { - vscode.commands.registerCommand('pig.adapterExecutable', () => provideDebugAdapterExecutable()); - - vscode.debug.registerDebugConfigurationProvider(PIG_DEBUG, - new DebugConfigurationProvider()); + context.subscriptions.push(vscode.commands.registerCommand('pig.adapterExecutable', () => provideDebugAdapterExecutable())); + vscode.debug.registerDebugConfigurationProvider(PIG_DEBUG, new DebugConfigurationProvider()); } function provideDebugAdapterExecutable(): any {