@vscode/python-extension
Version:
An API facade for the Python extension in VS Code
27 lines • 1.06 kB
JavaScript
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.PythonExtension = exports.PVSC_EXTENSION_ID = void 0;
const vscode_1 = require("vscode");
exports.PVSC_EXTENSION_ID = 'ms-python.python';
// eslint-disable-next-line @typescript-eslint/no-namespace
var PythonExtension;
(function (PythonExtension) {
/**
* Returns the API exposed by the Python extension in VS Code.
*/
async function api() {
const extension = vscode_1.extensions.getExtension(exports.PVSC_EXTENSION_ID);
if (extension === undefined) {
throw new Error(`Python extension is not installed or is disabled`);
}
if (!extension.isActive) {
await extension.activate();
}
const pythonApi = extension.exports;
return pythonApi;
}
PythonExtension.api = api;
})(PythonExtension = exports.PythonExtension || (exports.PythonExtension = {}));
//# sourceMappingURL=main.js.map
;