mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Show chat move actions without icons (#183481)
This commit is contained in:
parent
1052813be2
commit
56a0248733
|
@ -3,7 +3,6 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Codicon } from 'vs/base/common/codicons';
|
||||
import { localize } from 'vs/nls';
|
||||
import { Action2, IAction2Options, MenuId, registerAction2 } from 'vs/platform/actions/common/actions';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
|
@ -28,14 +27,12 @@ const getMoveToEditorChatActionDescriptorForViewTitle = (viewId: string, provide
|
|||
original: 'Open In Editor'
|
||||
},
|
||||
category: CHAT_CATEGORY,
|
||||
icon: Codicon.arrowLeft,
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: false,
|
||||
viewId,
|
||||
menu: {
|
||||
id: MenuId.ViewTitle,
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', viewId), ContextKeyExpr.deserialize('config.chat.experimental.moveIcons')),
|
||||
group: 'navigation',
|
||||
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', viewId)),
|
||||
order: 0
|
||||
},
|
||||
});
|
||||
|
@ -66,15 +63,13 @@ const getMoveToSidebarChatActionDescriptorForViewTitle = (viewId: string, provid
|
|||
original: 'Open In Sidebar'
|
||||
},
|
||||
category: CHAT_CATEGORY,
|
||||
icon: Codicon.arrowRight,
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: false, // TODO
|
||||
f1: false,
|
||||
viewId,
|
||||
menu: [{
|
||||
id: MenuId.EditorTitle,
|
||||
group: 'navigation',
|
||||
order: 0,
|
||||
when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID), ContextKeyExpr.deserialize('config.chat.experimental.moveIcons')),
|
||||
when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
|
||||
}]
|
||||
});
|
||||
|
||||
|
@ -135,9 +130,10 @@ export function registerMoveActions() {
|
|||
return;
|
||||
}
|
||||
|
||||
const sessionId = viewModel.sessionId;
|
||||
const view = await viewService.openView(widget.viewContext.viewId) as ChatViewPane;
|
||||
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: <IChatEditorOptions>{ target: { sessionId: viewModel.sessionId }, pinned: true } });
|
||||
view.clear();
|
||||
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: <IChatEditorOptions>{ target: { sessionId: sessionId }, pinned: true } });
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -151,7 +147,12 @@ export function registerMoveActions() {
|
|||
},
|
||||
category: CHAT_CATEGORY,
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: true
|
||||
f1: true,
|
||||
menu: [{
|
||||
id: MenuId.EditorTitle,
|
||||
order: 0,
|
||||
when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneCont
|
|||
import { IViewContainersRegistry, IViewDescriptor, IViewsRegistry, ViewContainer, ViewContainerLocation, Extensions as ViewExtensions } from 'vs/workbench/common/views';
|
||||
import { getHistoryAction, getOpenChatEditorAction } from 'vs/workbench/contrib/chat/browser/actions/chatActions';
|
||||
import { getClearAction } from 'vs/workbench/contrib/chat/browser/actions/chatClearActions';
|
||||
import { getMoveToEditorAction, getMoveToSidebarAction } from 'vs/workbench/contrib/chat/browser/actions/chatMoveActions';
|
||||
import { IChatViewOptions, CHAT_SIDEBAR_PANEL_ID, ChatViewPane } from 'vs/workbench/contrib/chat/browser/chatViewPane';
|
||||
import { getMoveToEditorAction } from 'vs/workbench/contrib/chat/browser/actions/chatMoveActions';
|
||||
import { CHAT_SIDEBAR_PANEL_ID, ChatViewPane, IChatViewOptions } from 'vs/workbench/contrib/chat/browser/chatViewPane';
|
||||
import { IChatContributionService, IChatProviderContribution, IRawChatProviderContribution } from 'vs/workbench/contrib/chat/common/chatContributionService';
|
||||
import * as extensionsRegistry from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||
|
||||
|
@ -145,7 +145,6 @@ export class ChatContributionService implements IChatContributionService {
|
|||
disposables.add(registerAction2(getHistoryAction(viewId, providerDescriptor.id)));
|
||||
disposables.add(registerAction2(getClearAction(viewId, providerDescriptor.id)));
|
||||
disposables.add(registerAction2(getMoveToEditorAction(viewId, providerDescriptor.id)));
|
||||
disposables.add(registerAction2(getMoveToSidebarAction(viewId, providerDescriptor.id)));
|
||||
|
||||
// "Open Chat Editor" Action
|
||||
disposables.add(registerAction2(getOpenChatEditorAction(providerDescriptor.id, providerDescriptor.label, providerDescriptor.when)));
|
||||
|
|
Loading…
Reference in a new issue