Skip to content

Commit

Permalink
Merge pull request #67 from mchadalavada/main
Browse files Browse the repository at this point in the history
Fix compile on save functionality
  • Loading branch information
ankushdesai authored Sep 20, 2023
2 parents 5d2ce65 + e7b7943 commit 204d599
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
19 changes: 11 additions & 8 deletions src/ide/ui/compileCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ export default class CompileCommands {

context.subscriptions.push(
vscode.workspace.onDidDeleteFiles((e) => generateProjects()),
vscode.workspace.onDidCreateFiles((e) => generateProjects())
// vscode.workspace.onDidChangeTextDocument(async (e) => {
// for (var t of await vscode.tasks.fetchTasks()) {
// if (t.name === "Compile") {
// vscode.tasks.executeTask(t);
// }
// }
// })
vscode.workspace.onDidCreateFiles((e) => generateProjects()),
// Trigger the compile task on saving P files only
vscode.workspace.onDidSaveTextDocument(async (e) => {
if(e.fileName.endsWith(".p")){
for (var t of await vscode.tasks.fetchTasks()) {
if (t.name === "Compile") {
vscode.tasks.executeTask(t);
}
}
}
})
);

return new CompileCommands();
Expand Down
4 changes: 2 additions & 2 deletions src/ide/ui/testinginEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ async function runHandler(
}

let tcOutput = vscode.window.createOutputChannel("Test Case Output");
tcOutput.appendLine("Running the Test Cases...\n");
tcOutput.show();

while (queue.length > 0) {
const test = queue.pop()!;
Expand Down Expand Up @@ -181,7 +183,6 @@ async function runPTestCase(run: vscode.TestRun, tc: vscode.TestItem, tcOutput:
}
}
//Sends P Check command through the terminal
terminal.show();
const outputDirectory = "PCheckerOutput/" + tc.label;
var outputFile = outputDirectory + "/check.log";
var projectDirectory = tc.uri?.fsPath.split("PTst")[0];
Expand Down Expand Up @@ -268,7 +269,6 @@ async function runCheckCommand(

// Prints in the output channel
tcOutput.appendLine("Executing command : " + command + "\n");
tcOutput.show();

//Runs command in separate shell that finds the test contents
try {
Expand Down

0 comments on commit 204d599

Please sign in to comment.