diff --git a/src/extension/index.ts b/src/extension/index.ts index 2fc50c7125e..d32d0ab77a4 100644 --- a/src/extension/index.ts +++ b/src/extension/index.ts @@ -80,6 +80,7 @@ export class Extensions { await this.manager.activateExtensions() let names = this.states.filterGlobalExtensions(workspace.env.globalExtensions) void this.installExtensions(names) + await this.promptRecommendedExtensions() // check extensions need watch & install let config = workspace.initialConfiguration.get('coc.preferences') as any let interval = config.extensionUpdateCheck @@ -92,6 +93,17 @@ export class Extensions { } } + public async promptRecommendedExtensions(): Promise { + const recommendations = workspace.getConfiguration('extensions', workspace.workspaceFolders[0]).get('recommendations', []) + const unInstalled = this.states.filterGlobalExtensions(recommendations) + if (unInstalled.length) { + const toInstalls = await window.showPickerDialog(unInstalled, 'Install recommend extensions?') + if (toInstalls?.length) { + await this.installExtensions(toInstalls) + } + } + } + public get onDidLoadExtension(): Event> { return this.manager.onDidLoadExtension }