mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-06 01:25:38 -05:00
Update action run return type (#15568)
* Update action run return type * fix tests * Update rest * Add back null checks
This commit is contained in:
@@ -50,23 +50,20 @@ export class InstallRecommendedExtensionsByScenarioAction extends Action {
|
||||
this.recommendations = recommendations;
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
if (!this.recommendations.length) { return Promise.resolve(); }
|
||||
return this.viewletService.openViewlet(VIEWLET_ID, true)
|
||||
.then(viewlet => viewlet?.getViewPaneContainer() as IExtensionsViewPaneContainer)
|
||||
.then(viewlet => {
|
||||
viewlet.search('@' + this.scenarioType);
|
||||
viewlet.focus();
|
||||
const names = this.recommendations.map(({ extensionId }) => extensionId);
|
||||
return this.extensionWorkbenchService.queryGallery({ names, source: 'install-' + this.scenarioType }, CancellationToken.None).then(pager => {
|
||||
let installPromises: Promise<any>[] = [];
|
||||
let model = new PagedModel(pager);
|
||||
for (let i = 0; i < pager.total; i++) {
|
||||
installPromises.push(model.resolve(i, CancellationToken.None).then(e => this.extensionWorkbenchService.install(e)));
|
||||
}
|
||||
return Promise.all(installPromises);
|
||||
});
|
||||
});
|
||||
async run(): Promise<void> {
|
||||
if (!this.recommendations.length) { return; }
|
||||
const viewlet = await this.viewletService.openViewlet(VIEWLET_ID, true);
|
||||
const viewPaneContainer = viewlet?.getViewPaneContainer() as IExtensionsViewPaneContainer;
|
||||
viewPaneContainer.search('@' + this.scenarioType);
|
||||
viewlet.focus();
|
||||
const names = this.recommendations.map(({ extensionId }) => extensionId);
|
||||
const pager = await this.extensionWorkbenchService.queryGallery({ names, source: 'install-' + this.scenarioType }, CancellationToken.None);
|
||||
let installPromises: Promise<any>[] = [];
|
||||
let model = new PagedModel(pager);
|
||||
for (let i = 0; i < pager.total; i++) {
|
||||
installPromises.push(model.resolve(i, CancellationToken.None).then(e => this.extensionWorkbenchService.install(e)));
|
||||
}
|
||||
await Promise.all(installPromises);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +81,7 @@ export class OpenExtensionAuthoringDocsAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
run(): Promise<boolean> {
|
||||
return this.openerService.open(URI.parse(OpenExtensionAuthoringDocsAction.extensionAuthoringDocsURI));
|
||||
async run(): Promise<void> {
|
||||
await this.openerService.open(URI.parse(OpenExtensionAuthoringDocsAction.extensionAuthoringDocsURI));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user