diff --git a/package-lock.json b/package-lock.json index 9e02e50c..2e750bcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,10 +15,8 @@ "@vscode/python-extension": "^1.0.5", "fs-extra": "^11.2.0", "iconv-lite": "^0.6.3", - "inversify": "^6.0.1", "jsonc-parser": "^3.2.0", "lodash": "^4.17.21", - "reflect-metadata": "^0.1.13", "vscode-languageclient": "^8.0.2" }, "devDependencies": { @@ -641,11 +639,10 @@ } }, "node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true, - "license": "MIT" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true }, "node_modules/@types/fs-extra": { "version": "11.0.4", @@ -1108,8 +1105,7 @@ "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.11.6", @@ -1322,7 +1318,6 @@ "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, - "license": "MIT", "peerDependencies": { "acorn": "^8" } @@ -1639,9 +1634,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", - "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "dev": true, "funding": [ { @@ -1659,8 +1654,8 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001663", - "electron-to-chromium": "^1.5.28", + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", "node-releases": "^2.0.18", "update-browserslist-db": "^1.1.0" }, @@ -1728,9 +1723,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001668", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001668.tgz", - "integrity": "sha512-nWLrdxqCdblixUO+27JtGJJE/txpJlyUy5YN1u53wLZkP0emYCo5zgS6QYft7VUYR42LGgi/S5hdLZTrnyIddw==", + "version": "1.0.30001655", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001655.tgz", + "integrity": "sha512-jRGVy3iSGO5Uutn2owlb5gR6qsGngTw9ZTb4ali9f3glshcNmJ2noam4Mo9zia5P9Dk3jNNydy7vQjuE5dQmfg==", "dev": true, "funding": [ { @@ -2268,11 +2263,10 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.36", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.36.tgz", - "integrity": "sha512-HYTX8tKge/VNp6FGO+f/uVDmUkq+cEfcxYhKf15Akc4M5yxt5YmorwlAitKWjWhWQnKcDRBAQKXkhqqXMqcrjw==", - "dev": true, - "license": "ISC" + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz", + "integrity": "sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==", + "dev": true }, "node_modules/emitter-listener": { "version": "1.1.2", @@ -3283,11 +3277,6 @@ "node": ">=10.13.0" } }, - "node_modules/inversify": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/inversify/-/inversify-6.0.1.tgz", - "integrity": "sha512-B3ex30927698TJENHR++8FfEaJGqoWOgI6ZY5Ht/nLUsFCwHn6akbwtnUAPCgUepAnTpe2qHxhDNjoKLyz6rgQ==" - }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -4048,8 +4037,7 @@ "version": "2.0.18", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/normalize-path": { "version": "3.0.0", @@ -4283,8 +4271,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/picomatch": { "version": "2.3.1", @@ -4561,11 +4548,6 @@ "node": ">= 10.13.0" } }, - "node_modules/reflect-metadata": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -5082,9 +5064,9 @@ } }, "node_modules/terser": { - "version": "5.34.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.34.1.tgz", - "integrity": "sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -5411,9 +5393,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", - "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "dev": true, "funding": [ { @@ -5431,8 +5413,8 @@ ], "license": "MIT", "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.0" + "escalade": "^3.1.2", + "picocolors": "^1.0.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -5548,9 +5530,9 @@ } }, "node_modules/webpack": { - "version": "5.95.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", - "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "license": "MIT", "dependencies": { @@ -6322,9 +6304,9 @@ } }, "@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "@types/fs-extra": { @@ -7070,13 +7052,13 @@ "dev": true }, "browserslist": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", - "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001663", - "electron-to-chromium": "^1.5.28", + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", "node-releases": "^2.0.18", "update-browserslist-db": "^1.1.0" } @@ -7119,9 +7101,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001668", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001668.tgz", - "integrity": "sha512-nWLrdxqCdblixUO+27JtGJJE/txpJlyUy5YN1u53wLZkP0emYCo5zgS6QYft7VUYR42LGgi/S5hdLZTrnyIddw==", + "version": "1.0.30001655", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001655.tgz", + "integrity": "sha512-jRGVy3iSGO5Uutn2owlb5gR6qsGngTw9ZTb4ali9f3glshcNmJ2noam4Mo9zia5P9Dk3jNNydy7vQjuE5dQmfg==", "dev": true }, "chai": { @@ -7515,9 +7497,9 @@ } }, "electron-to-chromium": { - "version": "1.5.36", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.36.tgz", - "integrity": "sha512-HYTX8tKge/VNp6FGO+f/uVDmUkq+cEfcxYhKf15Akc4M5yxt5YmorwlAitKWjWhWQnKcDRBAQKXkhqqXMqcrjw==", + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz", + "integrity": "sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==", "dev": true }, "emitter-listener": { @@ -8262,11 +8244,6 @@ "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", "dev": true }, - "inversify": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/inversify/-/inversify-6.0.1.tgz", - "integrity": "sha512-B3ex30927698TJENHR++8FfEaJGqoWOgI6ZY5Ht/nLUsFCwHn6akbwtnUAPCgUepAnTpe2qHxhDNjoKLyz6rgQ==" - }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -9246,11 +9223,6 @@ "resolve": "^1.20.0" } }, - "reflect-metadata": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -9619,9 +9591,9 @@ } }, "terser": { - "version": "5.34.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.34.1.tgz", - "integrity": "sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.3", @@ -9852,13 +9824,13 @@ "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" }, "update-browserslist-db": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", - "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "dev": true, "requires": { - "escalade": "^3.2.0", - "picocolors": "^1.1.0" + "escalade": "^3.1.2", + "picocolors": "^1.0.1" } }, "uri-js": { @@ -9953,9 +9925,9 @@ } }, "webpack": { - "version": "5.95.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", - "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "requires": { "@types/estree": "^1.0.5", diff --git a/package.json b/package.json index 4ee6e796..af9f5949 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "publisher": "ms-python", "enabledApiProposals": [ "portsAttributes", - "contribIssueReporter", "debugVisualization", "contribViewsWelcome" ], @@ -594,10 +593,8 @@ "@vscode/python-extension": "^1.0.5", "fs-extra": "^11.2.0", "iconv-lite": "^0.6.3", - "inversify": "^6.0.1", "jsonc-parser": "^3.2.0", "lodash": "^4.17.21", - "reflect-metadata": "^0.1.13", "vscode-languageclient": "^8.0.2" } } diff --git a/src/extension/common/promiseUtils.ts b/src/extension/common/promiseUtils.ts index 929a1d34..ccc8b06f 100644 --- a/src/extension/common/promiseUtils.ts +++ b/src/extension/common/promiseUtils.ts @@ -4,10 +4,3 @@ export function ignoreErrors(promise: Promise) { return promise.catch(() => {}); } - -// if (!String.prototype.format) { -// String.prototype.format = function (this: string) { -// const args = arguments; -// return this.replace(/{(\d+)}/g, (match, number) => (args[number] === undefined ? match : args[number])); -// }; -// } diff --git a/src/extension/debugger/adapter/factory.ts b/src/extension/debugger/adapter/factory.ts index 16bb50e0..1942d701 100644 --- a/src/extension/debugger/adapter/factory.ts +++ b/src/extension/debugger/adapter/factory.ts @@ -4,7 +4,6 @@ 'use strict'; -import { inject, injectable } from 'inversify'; import * as path from 'path'; import { DebugAdapterDescriptor, @@ -31,9 +30,8 @@ export enum debugStateKeys { doNotShowAgain = 'doNotShowPython36DebugDeprecatedAgain', } -@injectable() export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFactory { - constructor(@inject(IPersistentStateFactory) private persistentState: IPersistentStateFactory) {} + constructor(private persistentState: IPersistentStateFactory) {} public async createDebugAdapterDescriptor( session: DebugSession, diff --git a/src/extension/debugger/configuration/debugConfigurationService.ts b/src/extension/debugger/configuration/debugConfigurationService.ts index 50da3c18..8776f9b6 100644 --- a/src/extension/debugger/configuration/debugConfigurationService.ts +++ b/src/extension/debugger/configuration/debugConfigurationService.ts @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -'use strict'; - -import { inject, injectable, named } from 'inversify'; import { cloneDeep } from 'lodash'; import { CancellationToken, DebugConfiguration, QuickPickItem, WorkspaceFolder } from 'vscode'; import { DebugConfigStrings } from '../../common/utils/localize'; @@ -21,18 +18,13 @@ import { buildRemoteAttachConfiguration } from './providers/remoteAttach'; import { IDebugConfigurationResolver } from './types'; import { buildFileWithArgsLaunchDebugConfiguration } from './providers/fileLaunchWithArgs'; -@injectable() export class PythonDebugConfigurationService implements IDebugConfigurationService { private cacheDebugConfig: DebugConfiguration | undefined = undefined; constructor( - @inject(IDebugConfigurationResolver) - @named('attach') private readonly attachResolver: IDebugConfigurationResolver, - @inject(IDebugConfigurationResolver) - @named('launch') private readonly launchResolver: IDebugConfigurationResolver, - @inject(IMultiStepInputFactory) private readonly multiStepFactory: IMultiStepInputFactory, + private readonly multiStepFactory: IMultiStepInputFactory, ) {} public async provideDebugConfigurations( diff --git a/src/extension/debugger/hooks/childProcessAttachHandler.ts b/src/extension/debugger/hooks/childProcessAttachHandler.ts index f7d4ad34..c653c01d 100644 --- a/src/extension/debugger/hooks/childProcessAttachHandler.ts +++ b/src/extension/debugger/hooks/childProcessAttachHandler.ts @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -'use strict'; - -import { inject, injectable } from 'inversify'; import { DebugConfiguration, DebugSessionCustomEvent } from 'vscode'; import { swallowExceptions } from '../../common/utils/decorators'; import { AttachRequestArguments } from '../../types'; @@ -18,11 +15,9 @@ import { DebuggerTypeName } from '../../constants'; * @class ChildProcessAttachEventHandler * @implements {IDebugSessionEventHandlers} */ -@injectable() + export class ChildProcessAttachEventHandler implements IDebugSessionEventHandlers { - constructor( - @inject(IChildProcessAttachService) private readonly childProcessAttachService: IChildProcessAttachService, - ) {} + constructor(private readonly childProcessAttachService: IChildProcessAttachService) {} @swallowExceptions('Handle child process launch') public async handleCustomEvent(event: DebugSessionCustomEvent): Promise { diff --git a/src/extension/debugger/hooks/debugpySocketsHandler.ts b/src/extension/debugger/hooks/debugpySocketsHandler.ts index 3d5eaee1..15802b2e 100644 --- a/src/extension/debugger/hooks/debugpySocketsHandler.ts +++ b/src/extension/debugger/hooks/debugpySocketsHandler.ts @@ -3,7 +3,6 @@ 'use strict'; -import { inject, injectable } from 'inversify'; import { DebugSessionCustomEvent } from 'vscode'; import { swallowExceptions } from '../../common/utils/decorators'; import { DebuggerEvents } from './constants'; @@ -18,11 +17,8 @@ import { traceLog } from '../../common/log/logging'; * @class ChildProcessAttachEventHandler * @implements {IDebugSessionEventHandlers} */ -@injectable() export class DebugpySocketsHandler implements IDebugSessionEventHandlers { - constructor( - @inject(DebugPortAttributesProvider) private readonly debugPortAttributesProvider: DebugPortAttributesProvider, - ) {} + constructor(private readonly debugPortAttributesProvider: DebugPortAttributesProvider) {} @swallowExceptions('Handle child process launch') public async handleCustomEvent(event: DebugSessionCustomEvent): Promise { diff --git a/src/extension/extension.ts b/src/extension/extension.ts index 248d77d9..6404c6ca 100644 --- a/src/extension/extension.ts +++ b/src/extension/extension.ts @@ -1,44 +1,25 @@ 'use strict'; -// import * as vscode from 'vscode'; - -// This line should always be right on top. - -if ((Reflect as any).metadata === undefined) { - require('reflect-metadata'); -} - import { registerDebugger } from './extensionInit'; import { IExtensionContext } from './common/types'; import { createOutputChannel, registerCommand } from './common/vscodeapi'; import { Commands } from './common/constants'; -import { registerLogger, traceError, traceLog } from './common/log/logging'; +import { registerLogger, traceError } from './common/log/logging'; import { sendTelemetryEvent } from './telemetry'; import { EventName } from './telemetry/constants'; import { IExtensionApi } from './apiTypes'; -// this method is called when your extension is activated -// your extension is activated the very first time the command is executed -export async function activate(context: IExtensionContext): Promise { - let api: IExtensionApi; - // Setup logging +export async function activate(context: IExtensionContext): Promise { const outputChannel = createOutputChannel('Python Debugger'); context.subscriptions.push(outputChannel, registerLogger(outputChannel)); context.subscriptions.push(registerCommand(Commands.ViewOutput, () => outputChannel.show())); - traceLog(`Name: Python Debugger`); - traceLog(`Module: debugpy`); - try { - api = await registerDebugger(context); + const api = await registerDebugger(context); sendTelemetryEvent(EventName.DEBUG_SUCCESS_ACTIVATION); + return api; } catch (ex) { traceError('sendDebugpySuccessActivationTelemetry() failed.', ex); throw ex; // re-raise } - - return api; } - -// this method is called when your extension is deactivated -export function deactivate() {} diff --git a/src/test/unittest/index.ts b/src/test/unittest/index.ts index 640db77a..d1934133 100644 --- a/src/test/unittest/index.ts +++ b/src/test/unittest/index.ts @@ -3,10 +3,6 @@ import * as Mocha from 'mocha'; import * as glob from 'glob'; export function run(): Promise { - if ((Reflect as any).metadata === undefined) { - require('reflect-metadata'); - } - process.env.VSC_PYTHON_UNIT_TEST = '1'; // Create the mocha test const mocha = new Mocha({ diff --git a/src/test/unittests.ts b/src/test/unittests.ts index 22759796..e4cfdedc 100644 --- a/src/test/unittests.ts +++ b/src/test/unittests.ts @@ -14,10 +14,6 @@ if (os.platform() === 'win32') { }); } -if ((Reflect as any).metadata === undefined) { - require('reflect-metadata'); -} - process.env.VSC_PYTHON_CI_TEST = '1'; process.env.VSC_PYTHON_UNIT_TEST = '1'; process.env.NODE_ENV = 'production'; // Make sure react is using production bits or we can run out of memory.