Skip to content

Commit

Permalink
feat(chat): automatically pick the database & collection if there exi…
Browse files Browse the repository at this point in the history
…sts only one VSCODE-610 (#863)
  • Loading branch information
gagik authored Nov 8, 2024
1 parent 848b21c commit 9d666ff
Show file tree
Hide file tree
Showing 6 changed files with 506 additions and 299 deletions.
14 changes: 14 additions & 0 deletions src/participant/chatMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ export class ChatMetadataStore {
return this._chats[chatId];
}

patchChatMetadata(
context: vscode.ChatContext,
patchedMetadata: Partial<ChatMetadata>
): void {
const chatId = ChatMetadataStore.getChatIdFromHistoryOrNewChatId(
context.history
);

this.setChatMetadata(chatId, {
...this.getChatMetadata(chatId),
...patchedMetadata,
});
}

// Exposed for stubbing in tests.
static createNewChatId(): string {
return uuidv4();
Expand Down
Loading

0 comments on commit 9d666ff

Please sign in to comment.