@@ -34,8 +34,8 @@ const extensionPoint = ExtensionsRegistry.registerExtensionPoint<IChatSessionsEx
34
34
items : {
35
35
type : 'object' ,
36
36
properties : {
37
- id : {
38
- description : localize ( 'chatSessionsExtPoint.id ' , 'A unique identifier for this item .' ) ,
37
+ type : {
38
+ description : localize ( 'chatSessionsExtPoint.chatSessionType ' , 'Unique identifier for the type of chat session .' ) ,
39
39
type : 'string' ,
40
40
} ,
41
41
name : {
@@ -60,7 +60,7 @@ const extensionPoint = ExtensionsRegistry.registerExtensionPoint<IChatSessionsEx
60
60
} ,
61
61
activationEventsGenerator : ( contribs , results ) => {
62
62
for ( const contrib of contribs ) {
63
- results . push ( `onChatSession:${ contrib . id } ` ) ;
63
+ results . push ( `onChatSession:${ contrib . type } ` ) ;
64
64
}
65
65
}
66
66
} ) ;
@@ -82,14 +82,14 @@ export class ChatSessionsContribution extends Disposable implements IWorkbenchCo
82
82
}
83
83
for ( const contribution of ext . value ) {
84
84
const c : IChatSessionsExtensionPoint = {
85
- id : contribution . id ,
85
+ type : contribution . type ,
86
86
name : contribution . name ,
87
87
displayName : contribution . displayName ,
88
88
description : contribution . description ,
89
89
when : contribution . when ,
90
90
extensionDescription : ext . description ,
91
91
} ;
92
- this . logService . info ( `Registering chat session from extension contribution: ${ c . displayName } (id='${ c . id } ' name='${ c . name } ')` ) ;
92
+ this . logService . info ( `Registering chat session from extension contribution: ${ c . displayName } (id='${ c . type } ' name='${ c . name } ')` ) ;
93
93
this . _register ( this . chatSessionsService . registerContribution ( c ) ) ; // TODO: Is it for contribution to own this? I think not
94
94
}
95
95
}
@@ -146,8 +146,8 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
146
146
} ) ) ;
147
147
}
148
148
public registerContribution ( contribution : IChatSessionsExtensionPoint ) : IDisposable {
149
- if ( this . _contributions . has ( contribution . id ) ) {
150
- this . _logService . warn ( `Chat session contribution with id '${ contribution . id } ' is already registered.` ) ;
149
+ if ( this . _contributions . has ( contribution . type ) ) {
150
+ this . _logService . warn ( `Chat session contribution with id '${ contribution . type } ' is already registered.` ) ;
151
151
return { dispose : ( ) => { } } ;
152
152
}
153
153
@@ -161,15 +161,15 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
161
161
}
162
162
}
163
163
164
- this . _contributions . set ( contribution . id , contribution ) ;
164
+ this . _contributions . set ( contribution . type , contribution ) ;
165
165
166
166
// Register dynamic agent if the when condition is satisfied
167
167
this . _registerDynamicAgentIfAvailable ( contribution ) ;
168
168
169
169
return {
170
170
dispose : ( ) => {
171
- this . _contributions . delete ( contribution . id ) ;
172
- this . _disposeDynamicAgent ( contribution . id ) ;
171
+ this . _contributions . delete ( contribution . type ) ;
172
+ this . _disposeDynamicAgent ( contribution . type ) ;
173
173
}
174
174
} ;
175
175
}
@@ -186,7 +186,7 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
186
186
private _registerDynamicAgentIfAvailable ( contribution : IChatSessionsExtensionPoint ) : void {
187
187
if ( this . _isContributionAvailable ( contribution ) ) {
188
188
const disposable = this . _registerDynamicAgent ( contribution ) ;
189
- this . _dynamicAgentDisposables . set ( contribution . id , disposable ) ;
189
+ this . _dynamicAgentDisposables . set ( contribution . type , disposable ) ;
190
190
}
191
191
}
192
192
@@ -202,14 +202,14 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
202
202
let hasChanges = false ;
203
203
204
204
for ( const contribution of this . _contributions . values ( ) ) {
205
- const isCurrentlyRegistered = this . _dynamicAgentDisposables . has ( contribution . id ) ;
205
+ const isCurrentlyRegistered = this . _dynamicAgentDisposables . has ( contribution . type ) ;
206
206
const shouldBeRegistered = this . _isContributionAvailable ( contribution ) ;
207
207
208
208
if ( isCurrentlyRegistered && ! shouldBeRegistered ) {
209
209
// Should be unregistered
210
- this . _disposeDynamicAgent ( contribution . id ) ;
210
+ this . _disposeDynamicAgent ( contribution . type ) ;
211
211
// Also dispose any cached sessions for this contribution
212
- this . _disposeSessionsForContribution ( contribution . id ) ;
212
+ this . _disposeSessionsForContribution ( contribution . type ) ;
213
213
hasChanges = true ;
214
214
} else if ( ! isCurrentlyRegistered && shouldBeRegistered ) {
215
215
// Should be registered
@@ -230,7 +230,7 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
230
230
231
231
// Notify about session items changes for all chat session types
232
232
for ( const contribution of this . _contributions . values ( ) ) {
233
- this . _onDidChangeSessionItems . fire ( contribution . id ) ;
233
+ this . _onDidChangeSessionItems . fire ( contribution . type ) ;
234
234
}
235
235
}
236
236
}
@@ -257,7 +257,7 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
257
257
}
258
258
259
259
private _registerDynamicAgent ( contribution : IChatSessionsExtensionPoint ) : IDisposable {
260
- const { id, name, displayName, description, extensionDescription } = contribution ;
260
+ const { type : id , name, displayName, description, extensionDescription } = contribution ;
261
261
const { identifier : extensionId , name : extensionName , displayName : extensionDisplayName , publisher : extensionPublisherId } = extensionDescription ;
262
262
const agentData : IChatAgentData = {
263
263
id,
@@ -461,7 +461,7 @@ class CodingAgentChatImplementation extends Disposable implements IChatAgentImpl
461
461
const identifier = ChatSessionUri . parse ( editor . resource ) ;
462
462
463
463
if ( identifier ) {
464
- chatSession = await this . chatSessionService . provideChatSessionContent ( this . chatSession . id , identifier . sessionId , token ) ;
464
+ chatSession = await this . chatSessionService . provideChatSessionContent ( this . chatSession . type , identifier . sessionId , token ) ;
465
465
}
466
466
break ;
467
467
}
0 commit comments