Skip to content

Commit

Permalink
Merge pull request #115 from augustocdias/fix_112
Browse files Browse the repository at this point in the history
Fix #112 and release 1.12.4
  • Loading branch information
MarcelRobitaille authored Oct 3, 2024
2 parents 77e6e59 + d7daa20 commit 8182914
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
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

0 comments on commit 8182914

Please sign in to comment.