remove ExpTextButtons setting and logic but keep make buttons more dynamic (#225495)

This commit is contained in:
Johannes Rieken
2024-08-13 16:00:26 +02:00
committed by GitHub
parent 13b138216d
commit 3218292d9d
9 changed files with 29 additions and 144 deletions

View File

@@ -29,7 +29,7 @@ import { registerIcon } from 'vs/platform/theme/common/iconRegistry';
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
import { ILogService } from 'vs/platform/log/common/log';
import { IChatService } from 'vs/workbench/contrib/chat/common/chatService';
import { CONTEXT_IN_CHAT_INPUT } from 'vs/workbench/contrib/chat/common/chatContextKeys';
import { CONTEXT_CHAT_INPUT_HAS_TEXT, CONTEXT_IN_CHAT_INPUT } from 'vs/workbench/contrib/chat/common/chatContextKeys';
CommandsRegistry.registerCommandAlias('interactiveEditor.start', 'inlineChat.start');
CommandsRegistry.registerCommandAlias('interactive.acceptChanges', ACTION_ACCEPT_CHANGES);
@@ -269,6 +269,7 @@ export class AcceptChanges extends AbstractInlineChatAction {
group: '0_main',
order: 1,
when: ContextKeyExpr.and(
CONTEXT_CHAT_INPUT_HAS_TEXT.toNegated(),
CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.toNegated(),
CTX_INLINE_CHAT_RESPONSE_TYPE.isEqualTo(InlineChatResponseType.MessagesAndEdits)
),
@@ -294,6 +295,7 @@ export class DiscardHunkAction extends AbstractInlineChatAction {
group: '0_main',
order: 2,
when: ContextKeyExpr.and(
CONTEXT_CHAT_INPUT_HAS_TEXT.toNegated(),
CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.negate(),
CTX_INLINE_CHAT_RESPONSE_TYPE.isEqualTo(InlineChatResponseType.MessagesAndEdits),
CTX_INLINE_CHAT_EDIT_MODE.isEqualTo(EditMode.Live)
@@ -326,6 +328,7 @@ export class RerunAction extends AbstractInlineChatAction {
group: '0_main',
order: 5,
when: ContextKeyExpr.and(
CONTEXT_CHAT_INPUT_HAS_TEXT.toNegated(),
CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.negate(),
CTX_INLINE_CHAT_RESPONSE_TYPE.notEqualsTo(InlineChatResponseType.None)
)
@@ -498,6 +501,7 @@ export class ViewInChatAction extends AbstractInlineChatAction {
group: '0_main',
order: 1,
when: ContextKeyExpr.and(
CONTEXT_CHAT_INPUT_HAS_TEXT.toNegated(),
CTX_INLINE_CHAT_RESPONSE_TYPE.isEqualTo(InlineChatResponseType.Messages),
CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.negate()
)