Skip to content

Commit

Permalink
Use IExtensionsWorkbenchService instead (#236540)
Browse files Browse the repository at this point in the history
Use IExtensionsWorkbenchService
  • Loading branch information
roblourens authored Dec 19, 2024
1 parent dd86be1 commit acd32b1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/vs/workbench/contrib/chat/browser/chatSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { IConfigurationService } from '../../../../platform/configuration/common
import { ContextKeyExpr, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
import { IExtensionManagementService } from '../../../../platform/extensionManagement/common/extensionManagement.js';
import { ExtensionIdentifier } from '../../../../platform/extensions/common/extensions.js';
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
import { ILogService } from '../../../../platform/log/common/log.js';
Expand Down Expand Up @@ -60,7 +59,6 @@ import { IOpenerService } from '../../../../platform/opener/common/opener.js';
import { URI } from '../../../../base/common/uri.js';
import { IHostService } from '../../../services/host/browser/host.js';
import Severity from '../../../../base/common/severity.js';
import { IRemoteExtensionsScannerService } from '../../../../platform/remote/common/remoteExtensionsScanner.js';

const defaultChat = {
extensionId: product.defaultChatAgent?.extensionId ?? '',
Expand Down Expand Up @@ -1021,10 +1019,9 @@ class ChatSetupContext extends Disposable {
@IStorageService private readonly storageService: IStorageService,
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
@IExtensionService private readonly extensionService: IExtensionService,
@IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService,
@IWorkbenchExtensionEnablementService private readonly extensionEnablementService: IWorkbenchExtensionEnablementService,
@IRemoteExtensionsScannerService private readonly remoteExtensionsScannerService: IRemoteExtensionsScannerService,
@ILogService private readonly logService: ILogService
@ILogService private readonly logService: ILogService,
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
) {
super();

Expand All @@ -1049,10 +1046,9 @@ class ChatSetupContext extends Disposable {
}
}));

await this.remoteExtensionsScannerService.whenExtensionsReady();
const extensions = await this.extensionManagementService.getInstalled();
const extensions = await this.extensionsWorkbenchService.queryLocal();
const defaultChatExtension = extensions.find(value => ExtensionIdentifier.equals(value.identifier.id, defaultChat.extensionId));
this.update({ installed: !!defaultChatExtension && this.extensionEnablementService.isEnabled(defaultChatExtension) });
this.update({ installed: !!defaultChatExtension?.local && this.extensionEnablementService.isEnabled(defaultChatExtension.local) });
}

update(context: { installed: boolean }): Promise<void>;
Expand Down

0 comments on commit acd32b1

Please sign in to comment.