Skip to content

Commit 9d666ff

Browse files
authored
feat(chat): automatically pick the database & collection if there exists only one VSCODE-610 (#863)
1 parent 848b21c commit 9d666ff

File tree

6 files changed

+506
-299
lines changed

6 files changed

+506
-299
lines changed

src/participant/chatMetadata.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ export class ChatMetadataStore {
2020
return this._chats[chatId];
2121
}
2222

23+
patchChatMetadata(
24+
context: vscode.ChatContext,
25+
patchedMetadata: Partial<ChatMetadata>
26+
): void {
27+
const chatId = ChatMetadataStore.getChatIdFromHistoryOrNewChatId(
28+
context.history
29+
);
30+
31+
this.setChatMetadata(chatId, {
32+
...this.getChatMetadata(chatId),
33+
...patchedMetadata,
34+
});
35+
}
36+
2337
// Exposed for stubbing in tests.
2438
static createNewChatId(): string {
2539
return uuidv4();

0 commit comments

Comments
 (0)