Skip to content

Commit bad8881

Browse files
committed
Ensure all targets are from the same workspace before fetching local actions
Signed-off-by: worksofliam <[email protected]>
1 parent 8f1cbc9 commit bad8881

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/ui/actions.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,17 @@ export async function getAllAvailableActions(targets: ActionTarget[], scheme: st
584584

585585
// Then, if we're being called from a local file
586586
// we fetch the Actions defined from the workspace.
587-
if (targets[0].workspaceFolder && scheme === `file`) {
588-
const localActions = await getLocalActions(targets[0].workspaceFolder);
589-
allActions.push(...localActions);
587+
const firstWorkspace = targets[0].workspaceFolder;
588+
589+
// We need to make sure that all targets are from the same workspace
590+
if (firstWorkspace && firstWorkspace.uri.scheme === `file`) {
591+
const workspaceId = firstWorkspace.index;
592+
const allTargetsInOne = targets.every(t => t.workspaceFolder?.index === workspaceId);
593+
594+
if (allTargetsInOne) {
595+
const localActions = await getLocalActions(firstWorkspace);
596+
allActions.push(...localActions);
597+
}
590598
}
591599

592600
// We make sure all extensions are uppercase

0 commit comments

Comments
 (0)