Skip to content

Commit

Permalink
fix(vscode): quick pick list for chat edit should always show current…
Browse files Browse the repository at this point in the history
… inputcommand. (#2376)
  • Loading branch information
icycodes authored Jun 7, 2024
1 parent 1cf971c commit f6126e2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions clients/vscode/src/Commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,6 @@ export class Commands {
const updateQuickPickList = () => {
const input = quickPick.value;
const list: (QuickPickItem & { value: string })[] = [];
if (input.length > 0 && !input.startsWith("/")) {
list.push({
label: input,
value: input,
iconPath: new ThemeIcon("run"),
description: "",
alwaysShow: true,
});
}
list.push(
...suggestedCommand.map((item) => {
return {
Expand Down Expand Up @@ -323,6 +314,15 @@ export class Commands {
};
}),
);
if (input.length > 0 && !list.find((i) => i.value === input)) {
list.unshift({
label: input,
value: input,
iconPath: new ThemeIcon("run"),
description: "",
alwaysShow: true,
});
}
quickPick.items = list;
};
const fetchingSuggestedCommandCancellationTokenSource = new CancellationTokenSource();
Expand Down

0 comments on commit f6126e2

Please sign in to comment.