mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 01:25:38 -05:00
Add prompt to install required extensions for resource deployment (#14870)
This commit is contained in:
@@ -7,8 +7,10 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { ExtensionsLabel } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionsLabel, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { OpenExtensionAuthoringDocsAction } from 'sql/workbench/contrib/extensions/browser/extensionsActions';
|
||||
import { localize } from 'vs/nls';
|
||||
import { deepClone } from 'vs/base/common/objects';
|
||||
|
||||
// Global Actions
|
||||
const actionRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions);
|
||||
@@ -23,3 +25,27 @@ CommandsRegistry.registerCommand('azdata.extension.open', (accessor: ServicesAcc
|
||||
throw new Error('Extension id is not provided');
|
||||
}
|
||||
});
|
||||
|
||||
CommandsRegistry.registerCommand({
|
||||
id: 'workbench.extensions.getExtensionFromGallery',
|
||||
description: {
|
||||
description: localize('workbench.extensions.getExtensionFromGallery.description', "Gets extension information from the gallery"),
|
||||
args: [
|
||||
{
|
||||
name: localize('workbench.extensions.getExtensionFromGallery.arg.name', "Extension id"),
|
||||
schema: {
|
||||
'type': ['string']
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
handler: async (accessor, arg: string) => {
|
||||
const extensionGalleryService = accessor.get(IExtensionGalleryService);
|
||||
const extension = await extensionGalleryService.getCompatibleExtension({ id: arg });
|
||||
if (extension) {
|
||||
return deepClone(extension);
|
||||
} else {
|
||||
throw new Error(localize('notFound', "Extension '{0}' not found.", arg));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user