mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
Don't show Chat actions unless a chat provider is registered (#183144)
This commit is contained in:
parent
a8b3f64590
commit
d867c0a0f4
|
@ -21,7 +21,7 @@ import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat';
|
|||
import { IChatEditorOptions } from 'vs/workbench/contrib/chat/browser/chatEditor';
|
||||
import { ChatEditorInput } from 'vs/workbench/contrib/chat/browser/chatEditorInput';
|
||||
import { ChatViewPane } from 'vs/workbench/contrib/chat/browser/chatViewPane';
|
||||
import { CONTEXT_IN_CHAT_INPUT, CONTEXT_IN_CHAT_SESSION } from 'vs/workbench/contrib/chat/common/chatContextKeys';
|
||||
import { CONTEXT_IN_CHAT_INPUT, CONTEXT_IN_CHAT_SESSION, CONTEXT_PROVIDER_EXISTS } from 'vs/workbench/contrib/chat/common/chatContextKeys';
|
||||
import { IChatDetail, IChatService } from 'vs/workbench/contrib/chat/common/chatService';
|
||||
import { IChatWidgetHistoryService } from 'vs/workbench/contrib/chat/common/chatWidgetHistoryService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
|
@ -83,7 +83,7 @@ export function registerChatActions() {
|
|||
}
|
||||
});
|
||||
|
||||
registerAction2(class ClearEditorAction extends Action2 {
|
||||
registerAction2(class ClearChatHistoryAction extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.action.chatEditor.clearHistory',
|
||||
|
@ -91,6 +91,7 @@ export function registerChatActions() {
|
|||
value: localize('interactiveSession.clearHistory.label', "Clear Input History"),
|
||||
original: 'Clear Input History'
|
||||
},
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
category: CHAT_CATEGORY,
|
||||
f1: true,
|
||||
});
|
||||
|
@ -175,6 +176,7 @@ export function registerChatActions() {
|
|||
},
|
||||
category: CHAT_CATEGORY,
|
||||
icon: Codicon.clearAll,
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: true,
|
||||
keybinding: {
|
||||
weight: KeybindingWeight.WorkbenchContrib,
|
||||
|
|
|
@ -21,7 +21,7 @@ import { TerminalLocation } from 'vs/platform/terminal/common/terminal';
|
|||
import { IUntitledTextResourceEditorInput } from 'vs/workbench/common/editor';
|
||||
import { CHAT_CATEGORY } from 'vs/workbench/contrib/chat/browser/actions/chatActions';
|
||||
import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat';
|
||||
import { CONTEXT_IN_CHAT_SESSION } from 'vs/workbench/contrib/chat/common/chatContextKeys';
|
||||
import { CONTEXT_IN_CHAT_SESSION, CONTEXT_PROVIDER_EXISTS } from 'vs/workbench/contrib/chat/common/chatContextKeys';
|
||||
import { IChatCopyAction, IChatService, IChatUserActionEvent, InteractiveSessionCopyKind } from 'vs/workbench/contrib/chat/common/chatService';
|
||||
import { IChatResponseViewModel, isResponseVM } from 'vs/workbench/contrib/chat/common/chatViewModel';
|
||||
import { insertCell } from 'vs/workbench/contrib/notebook/browser/controller/cellOperations';
|
||||
|
@ -165,6 +165,7 @@ export function registerChatCodeBlockActions() {
|
|||
value: localize('interactive.insertCodeBlock.label', "Insert at Cursor"),
|
||||
original: 'Insert at Cursor'
|
||||
},
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: true,
|
||||
category: CHAT_CATEGORY,
|
||||
icon: Codicon.insert,
|
||||
|
@ -268,6 +269,7 @@ export function registerChatCodeBlockActions() {
|
|||
value: localize('interactive.insertIntoNewFile.label', "Insert Into New File"),
|
||||
original: 'Insert Into New File'
|
||||
},
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: true,
|
||||
category: CHAT_CATEGORY,
|
||||
icon: Codicon.newFile,
|
||||
|
@ -305,6 +307,7 @@ export function registerChatCodeBlockActions() {
|
|||
value: localize('interactive.runInTerminal.label', "Run in Terminal"),
|
||||
original: 'Run in Terminal'
|
||||
},
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: true,
|
||||
category: CHAT_CATEGORY,
|
||||
icon: Codicon.terminal,
|
||||
|
@ -400,6 +403,7 @@ export function registerChatCodeBlockActions() {
|
|||
weight: KeybindingWeight.WorkbenchContrib,
|
||||
when: CONTEXT_IN_CHAT_SESSION,
|
||||
},
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: true,
|
||||
category: CHAT_CATEGORY,
|
||||
});
|
||||
|
@ -423,6 +427,7 @@ export function registerChatCodeBlockActions() {
|
|||
weight: KeybindingWeight.WorkbenchContrib,
|
||||
when: CONTEXT_IN_CHAT_SESSION,
|
||||
},
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: true,
|
||||
category: CHAT_CATEGORY,
|
||||
});
|
||||
|
|
|
@ -14,6 +14,7 @@ import { CHAT_CATEGORY } from 'vs/workbench/contrib/chat/browser/actions/chatAct
|
|||
import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat';
|
||||
import { IChatEditorOptions } from 'vs/workbench/contrib/chat/browser/chatEditor';
|
||||
import { ChatEditorInput } from 'vs/workbench/contrib/chat/browser/chatEditorInput';
|
||||
import { CONTEXT_PROVIDER_EXISTS } from 'vs/workbench/contrib/chat/common/chatContextKeys';
|
||||
import { isExportableSessionData } from 'vs/workbench/contrib/chat/common/chatModel';
|
||||
import { IChatService } from 'vs/workbench/contrib/chat/common/chatService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
|
@ -31,6 +32,7 @@ export function registerChatExportActions() {
|
|||
value: localize('chat.export.label', "Export Session") + '...',
|
||||
original: 'Export Session...'
|
||||
},
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: true,
|
||||
});
|
||||
}
|
||||
|
@ -74,6 +76,7 @@ export function registerChatExportActions() {
|
|||
original: 'Export Session...'
|
||||
},
|
||||
category: CHAT_CATEGORY,
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: true,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import { ChatViewModel } from 'vs/workbench/contrib/chat/common/chatViewModel';
|
|||
import { CHAT_CATEGORY } from 'vs/workbench/contrib/chat/browser/actions/chatActions';
|
||||
import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { CONTEXT_PROVIDER_EXISTS } from 'vs/workbench/contrib/chat/common/chatContextKeys';
|
||||
|
||||
export function registerChatQuickQuestionActions() {
|
||||
registerAction2(AskQuickQuestionAction);
|
||||
|
@ -41,6 +42,7 @@ class AskQuickQuestionAction extends Action2 {
|
|||
super({
|
||||
id: 'chat.action.askQuickQuestion',
|
||||
title: { value: localize('askQuickQuestion', "Ask Quick Question"), original: 'Ask Quick Question' },
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
f1: true,
|
||||
category: CHAT_CATEGORY,
|
||||
keybinding: {
|
||||
|
|
Loading…
Reference in a new issue