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/360 run action build current wrong path #399

Merged
merged 9 commits into from
Mar 19, 2024
1 change: 1 addition & 0 deletions src/testing/suites/iProject.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
/*
* (c) Copyright IBM Corp. 2023
*/
Expand Down
20 changes: 14 additions & 6 deletions src/views/projectExplorer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -996,17 +996,25 @@ export default class ProjectExplorer implements TreeDataProvider<ProjectExplorer
}),
commands.registerCommand(`vscode-ibmi-projectexplorer.runAction`, async (element: Project | ObjectFile | MemberFile) => {
if (element) {
let chosenUri = element.resourceUri;

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

await commands.executeCommand(`code-for-ibmi.runAction`, {
resourceUri: element.workspaceFolder.uri
});
const activeProject = ProjectManager.getActiveProject();
chosenUri = activeProject?.workspaceFolder.uri;
let activeEditor = window.activeTextEditor;

if (activeEditor) {
const editorProject = ProjectManager.getProjectFromUri(activeEditor.document.uri);
if (activeProject?.workspaceFolder.uri === editorProject?.workspaceFolder.uri) {
chosenUri = activeEditor.document.uri;
}
}
}

await commands.executeCommand(`code-for-ibmi.runAction`, {
resourceUri: element.resourceUri
});
await commands.executeCommand(`code-for-ibmi.runAction`, chosenUri);

this.refresh();
}
Expand Down
Loading