const testExt = vscode.extensions.getExtension('my-test-extension'); if (!testExt) { vscode.window.showErrorMessage('My Test Extension is not installed.'); } else { testExt.exports.doSomething(); }
const pythonExt = vscode.extensions.getExtension('ms-python.python'); if (pythonExt) { const pythonAPI = pythonExt.exports; pythonAPI.configure('my-config'); }In this example, we are getting the Python VSCode extension with the identifier 'ms-python.python'. If it exists, we are fetching the extension's API and calling the 'configure()' function with the argument 'my-config'. The package/library that the getExtension method is a part of is the VSCode API library.