Path: blob/main/src/vs/workbench/contrib/chat/electron-browser/actions/chatDeveloperActions.ts
4780 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/4import { Codicon } from '../../../../../base/common/codicons.js';5import { ServicesAccessor } from '../../../../../editor/browser/editorExtensions.js';6import { localize2 } from '../../../../../nls.js';7import { Categories } from '../../../../../platform/action/common/actionCommonCategories.js';8import { Action2, registerAction2 } from '../../../../../platform/actions/common/actions.js';9import { INativeHostService } from '../../../../../platform/native/common/native.js';10import { ChatContextKeys } from '../../common/actions/chatContextKeys.js';11import { IChatService } from '../../common/chatService/chatService.js';1213export function registerChatDeveloperActions() {14registerAction2(OpenChatStorageFolderAction);15}1617class OpenChatStorageFolderAction extends Action2 {18static readonly ID = 'workbench.action.chat.openStorageFolder';1920constructor() {21super({22id: OpenChatStorageFolderAction.ID,23title: localize2('workbench.action.chat.openStorageFolder.label', "Open Chat Storage Folder"),24icon: Codicon.attach,25category: Categories.Developer,26f1: true,27precondition: ChatContextKeys.enabled28});29}3031override async run(accessor: ServicesAccessor, ...args: unknown[]): Promise<void> {32const chatService = accessor.get(IChatService);33const nativeHostService = accessor.get(INativeHostService);34const storagePath = chatService.getChatStorageFolder();35nativeHostService.showItemInFolder(storagePath.fsPath);36}37}383940