Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gagik committed Nov 8, 2024
1 parent 86a33f2 commit 4ad4c5f
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/participant/prompts/promptBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ export abstract class PromptBase<TArgs extends PromptArgsBase> {
| vscode.ChatRequestTurn
| vscode.ChatResponseTurn
| undefined = undefined;

const namespaceIsKnown =
databaseName !== undefined && collectionName !== undefined;
for (const historyItem of context.history) {
if (historyItem instanceof vscode.ChatRequestTurn) {
if (
Expand All @@ -200,11 +203,7 @@ export abstract class PromptBase<TArgs extends PromptArgsBase> {
.intent;

// If the namespace is already known, skip responses to prompts asking for it.
if (
responseIntent === 'askForNamespace' &&
databaseName !== undefined &&
collectionName !== undefined
) {
if (responseIntent === 'askForNamespace' && namespaceIsKnown) {
previousItem = historyItem;
continue;
}
Expand Down Expand Up @@ -241,11 +240,7 @@ export abstract class PromptBase<TArgs extends PromptArgsBase> {
}

// If the namespace is already known, skip including prompts asking for it.
if (
responseType === 'askForNamespace' &&
databaseName !== undefined &&
collectionName !== undefined
) {
if (responseType === 'askForNamespace' && namespaceIsKnown) {
previousItem = historyItem;
continue;
}
Expand Down

0 comments on commit 4ad4c5f

Please sign in to comment.