44 *--------------------------------------------------------------------------------------------*/
55
66import { KeyCode } from '../../../../../base/common/keyCodes.js' ;
7- import { isObject , isString } from '../../../../../base/common/types.js' ;
87import { localize , localize2 } from '../../../../../nls.js' ;
98import { Action2 , MenuId , MenuRegistry , registerAction2 } from '../../../../../platform/actions/common/actions.js' ;
109import { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js' ;
@@ -20,8 +19,8 @@ import { ResourceContextKey } from '../../../../common/contextkeys.js';
2019import { ChatContextKeys } from '../../common/actions/chatContextKeys.js' ;
2120import { CONTEXT_MODELS_EDITOR , CONTEXT_MODELS_SEARCH_FOCUS , MANAGE_CHAT_COMMAND_ID } from '../../common/constants.js' ;
2221import { CHAT_CATEGORY } from '../actions/chatActions.js' ;
23- import { ChatManagementEditor , ModelsManagementEditor } from './chatManagementEditor.js' ;
24- import { ChatManagementEditorInput , ModelsManagementEditorInput } from './chatManagementEditorInput.js' ;
22+ import { ModelsManagementEditor } from './chatManagementEditor.js' ;
23+ import { ModelsManagementEditorInput } from './chatManagementEditorInput.js' ;
2524import { ILanguageModelsConfigurationService } from '../../common/languageModelsConfiguration.js' ;
2625import { Codicon } from '../../../../../base/common/codicons.js' ;
2726import { registerIcon } from '../../../../../platform/theme/common/iconRegistry.js' ;
@@ -40,17 +39,6 @@ const LANGUAGE_MODELS_ENTITLEMENT_PRECONDITION = ContextKeyExpr.and(ChatContextK
4039 ChatContextKeys . Entitlement . internal
4140) ) ;
4241
43- Registry . as < IEditorPaneRegistry > ( EditorExtensions . EditorPane ) . registerEditorPane (
44- EditorPaneDescriptor . create (
45- ChatManagementEditor ,
46- ChatManagementEditor . ID ,
47- localize ( 'chatManagementEditor' , "Chat Management Editor" )
48- ) ,
49- [
50- new SyncDescriptor ( ChatManagementEditorInput )
51- ]
52- ) ;
53-
5442Registry . as < IEditorPaneRegistry > ( EditorExtensions . EditorPane ) . registerEditorPane (
5543 EditorPaneDescriptor . create (
5644 ModelsManagementEditor ,
@@ -62,21 +50,6 @@ Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane).registerEditorPane
6250 ]
6351) ;
6452
65- class ChatManagementEditorInputSerializer implements IEditorSerializer {
66-
67- canSerialize ( editorInput : EditorInput ) : boolean {
68- return true ;
69- }
70-
71- serialize ( input : ChatManagementEditorInput ) : string {
72- return '' ;
73- }
74-
75- deserialize ( instantiationService : IInstantiationService ) : ChatManagementEditorInput {
76- return instantiationService . createInstance ( ChatManagementEditorInput ) ;
77- }
78- }
79-
8053class ModelsManagementEditorInputSerializer implements IEditorSerializer {
8154
8255 canSerialize ( editorInput : EditorInput ) : boolean {
@@ -92,31 +65,8 @@ class ModelsManagementEditorInputSerializer implements IEditorSerializer {
9265 }
9366}
9467
95- Registry . as < IEditorFactoryRegistry > ( EditorExtensions . EditorFactory ) . registerEditorSerializer ( ChatManagementEditorInput . ID , ChatManagementEditorInputSerializer ) ;
9668Registry . as < IEditorFactoryRegistry > ( EditorExtensions . EditorFactory ) . registerEditorSerializer ( ModelsManagementEditorInput . ID , ModelsManagementEditorInputSerializer ) ;
9769
98- interface IOpenManageCopilotEditorActionOptions {
99- query ?: string ;
100- section ?: string ;
101- }
102-
103- function sanitizeString ( arg : unknown ) : string | undefined {
104- return isString ( arg ) ? arg : undefined ;
105- }
106-
107- function sanitizeOpenManageCopilotEditorArgs ( input : unknown ) : IOpenManageCopilotEditorActionOptions {
108- if ( ! isObject ( input ) ) {
109- input = { } ;
110- }
111-
112- const args = < IOpenManageCopilotEditorActionOptions > input ;
113-
114- return {
115- query : sanitizeString ( args ?. query ) ,
116- section : sanitizeString ( args ?. section )
117- } ;
118- }
119-
12070class ChatManagementActionsContribution extends Disposable implements IWorkbenchContribution {
12171
12272 static readonly ID = 'workbench.contrib.chatManagementActions' ;
@@ -140,9 +90,8 @@ class ChatManagementActionsContribution extends Disposable implements IWorkbench
14090 f1 : true ,
14191 } ) ;
14292 }
143- async run ( accessor : ServicesAccessor , args : string | IOpenManageCopilotEditorActionOptions ) {
93+ async run ( accessor : ServicesAccessor ) {
14494 const editorService = accessor . get ( IEditorService ) ;
145- args = sanitizeOpenManageCopilotEditorArgs ( args ) ;
14695 return editorService . openEditor ( new ModelsManagementEditorInput ( ) , { pinned : true } ) ;
14796 }
14897 } ) ) ;
0 commit comments