@@ -8,15 +8,13 @@ import { URI } from '../../../../../../base/common/uri.js';
8
8
import { CHAT_CATEGORY } from '../../actions/chatActions.js' ;
9
9
import { IChatWidget , IChatWidgetService } from '../../chat.js' ;
10
10
import { KeyMod , KeyCode } from '../../../../../../base/common/keyCodes.js' ;
11
- import { Registry } from '../../../../../../platform/registry /common/platform .js' ;
11
+ import { PromptsConfig } from '../../../../../../platform/prompts /common/config .js' ;
12
12
import { IViewsService } from '../../../../../services/views/common/viewsService.js' ;
13
13
import { isPromptFile } from '../../../../../../platform/prompts/common/constants.js' ;
14
- import { LifecyclePhase } from '../../../../../services/lifecycle/common/lifecycle.js' ;
15
14
import { IEditorService } from '../../../../../services/editor/common/editorService.js' ;
16
15
import { ICommandService } from '../../../../../../platform/commands/common/commands.js' ;
17
16
import { appendToCommandPalette } from '../../../../files/browser/fileActions.contribution.js' ;
18
17
import { ServicesAccessor } from '../../../../../../platform/instantiation/common/instantiation.js' ;
19
- import { IWorkbenchContributionsRegistry , Extensions } from '../../../../../common/contributions.js' ;
20
18
import { IActiveCodeEditor , isCodeEditor , isDiffEditor } from '../../../../../../editor/browser/editorBrowser.js' ;
21
19
import { KeybindingsRegistry , KeybindingWeight } from '../../../../../../platform/keybinding/common/keybindingsRegistry.js' ;
22
20
import { IChatAttachPromptActionOptions , ATTACH_PROMPT_ACTION_ID } from '../../actions/chatAttachPromptAction/chatAttachPromptAction.js' ;
@@ -135,6 +133,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
135
133
weight : KeybindingWeight . WorkbenchContrib ,
136
134
primary : COMMAND_KEY_BINDING ,
137
135
handler : command ,
136
+ when : PromptsConfig . ENABLED_CTX ,
138
137
} ) ;
139
138
140
139
/**
@@ -146,10 +145,5 @@ appendToCommandPalette(
146
145
title : localize ( 'commands.prompts.use.title' , "Use Prompt" ) ,
147
146
category : CHAT_CATEGORY ,
148
147
} ,
148
+ PromptsConfig . ENABLED_CTX ,
149
149
) ;
150
-
151
- class RunIfEnabled { }
152
-
153
- // register the command as a workbench contribution
154
- Registry . as < IWorkbenchContributionsRegistry > ( Extensions . Workbench )
155
- . registerWorkbenchContribution ( RunIfEnabled , LifecyclePhase . Eventually ) ;
0 commit comments