Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #112 and release 1.12.4 #115

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [1.12.4] 2024-10-03

- Work around VSCode bug with activeItems and selectedItems (#112)

## [1.12.3] 2024-10-03

- Fix custom values not being returned (#113)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Tasks Shell Input",
"description": "Use shell commands as input for your tasks",
"icon": "icon.png",
"version": "1.12.3",
"version": "1.12.4",
"publisher": "augustocdias",
"repository": {
"url": "https://github.com/augustocdias/vscode-shell-command"
Expand Down
11 changes: 9 additions & 2 deletions src/lib/CommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,15 @@ export class CommandHandler {
disposable = vscode.Disposable.from(...disposableLikes);

picker.items = constantItems;
picker.activeItems = picker.items.filter(
(item) => defaultValues.includes((item as QuickPickItem).value));

const activeItems = [...picker.items.filter(
(item) => defaultValues.includes((item as QuickPickItem).value))];

// Assigning unconditionally can break selectedItems in callbacks
// See #112
if (activeItems.length) {
picker.activeItems = activeItems;
}

picker.show();
}).finally(() => {
Expand Down
Loading