Skip to content

Commit

Permalink
Merge pull request #575 from IBM/feature/run-action-workspace-folder
Browse files Browse the repository at this point in the history
Use local `LIBL` and `CURLIB` for running actions on objects and members
  • Loading branch information
edmundreinhardt authored Sep 4, 2024
2 parents 3abcd0f + fb81c47 commit 31e8478
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/views/projectExplorer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1066,9 +1066,10 @@ export default class ProjectExplorer implements TreeDataProvider<ProjectExplorer
}),
commands.registerCommand(`vscode-ibmi-projectexplorer.runAction`, async (element: Project | ObjectFile | MemberFile) => {
if (element) {
let workspaceFolder;
let chosenUri = element.resourceUri;

// if project, get the uri of the active editor file if appropriate
// If project, get the uri of the active editor file if appropriate
if (element instanceof Project) {
await ProjectManager.setActiveProject(element.workspaceFolder);

Expand All @@ -1082,9 +1083,12 @@ export default class ProjectExplorer implements TreeDataProvider<ProjectExplorer
chosenUri = activeEditor.document.uri;
}
}
} else {
// Set workspace folder for objects and members so the project's LIBL and CURLIB are used
workspaceFolder = element.workspaceFolder;
}

await commands.executeCommand(`code-for-ibmi.runAction`, chosenUri);
await commands.executeCommand(`code-for-ibmi.runAction`, chosenUri, undefined, undefined, undefined, workspaceFolder);

this.refresh();
}
Expand Down

0 comments on commit 31e8478

Please sign in to comment.