|
1 | 1 | 'use strict';
|
2 | 2 |
|
3 |
| -// import * as vscode from 'vscode'; |
4 |
| - |
5 |
| -// This line should always be right on top. |
6 |
| - |
7 |
| -if ((Reflect as any).metadata === undefined) { |
8 |
| - require('reflect-metadata'); |
9 |
| -} |
10 |
| - |
11 | 3 | import { registerDebugger } from './extensionInit';
|
12 | 4 | import { IExtensionContext } from './common/types';
|
13 | 5 | import { createOutputChannel, registerCommand } from './common/vscodeapi';
|
14 | 6 | import { Commands } from './common/constants';
|
15 |
| -import { registerLogger, traceError, traceLog } from './common/log/logging'; |
| 7 | +import { registerLogger, traceError } from './common/log/logging'; |
16 | 8 | import { sendTelemetryEvent } from './telemetry';
|
17 | 9 | import { EventName } from './telemetry/constants';
|
18 | 10 | import { IExtensionApi } from './apiTypes';
|
19 | 11 |
|
20 |
| -// this method is called when your extension is activated |
21 |
| -// your extension is activated the very first time the command is executed |
22 |
| -export async function activate(context: IExtensionContext): Promise<IExtensionApi> { |
23 |
| - let api: IExtensionApi; |
24 |
| - // Setup logging |
| 12 | +export async function activate(context: IExtensionContext): Promise<IExtensionApi | undefined> { |
25 | 13 | const outputChannel = createOutputChannel('Python Debugger');
|
26 | 14 | context.subscriptions.push(outputChannel, registerLogger(outputChannel));
|
27 | 15 | context.subscriptions.push(registerCommand(Commands.ViewOutput, () => outputChannel.show()));
|
28 | 16 |
|
29 |
| - traceLog(`Name: Python Debugger`); |
30 |
| - traceLog(`Module: debugpy`); |
31 |
| - |
32 | 17 | try {
|
33 |
| - api = await registerDebugger(context); |
| 18 | + const api = await registerDebugger(context); |
34 | 19 | sendTelemetryEvent(EventName.DEBUG_SUCCESS_ACTIVATION);
|
| 20 | + return api; |
35 | 21 | } catch (ex) {
|
36 | 22 | traceError('sendDebugpySuccessActivationTelemetry() failed.', ex);
|
37 | 23 | throw ex; // re-raise
|
38 | 24 | }
|
39 |
| - |
40 |
| - return api; |
41 | 25 | }
|
42 |
| - |
43 |
| -// this method is called when your extension is deactivated |
44 |
| -export function deactivate() {} |
0 commit comments