Skip to content

Commit

Permalink
IDE: prevent syntax check from stopping an active build.
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliomoro committed Apr 17, 2022
1 parent 4ba6fe5 commit 8ab22b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions IDE/dist/ProcessManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,21 +168,21 @@ function upload(data) {
}
exports.upload = upload;
// this function starts a syntax check
// if a syntax check or build process is in progress they are stopped
// a running program is not stopped
// if a build is in progress, syntax check is not started
// if a syntax check is in progress it is restarted
// in all other cases, a syntax check is started immediately
// this can be called either from upload() or from the frontend (via SocketManager)
function checkSyntax(data) {
if (!data.currentProject)
return;
var project = data.currentProject;
if (processes.syntax.get_status()) {
if (processes.build.get_status()) {
// do nothing
}
else if (processes.syntax.get_status()) {
processes.syntax.stop();
processes.syntax.queue(function () { return processes.syntax.start(project); });
}
else if (processes.build.get_status()) {
processes.build.stop();
processes.build.queue(function () { return processes.syntax.start(project); });
}
else {
processes.syntax.start(project);
}
Expand Down
12 changes: 6 additions & 6 deletions IDE/src/ProcessManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,19 @@ export async function upload(data: any){
}

// this function starts a syntax check
// if a syntax check or build process is in progress they are stopped
// a running program is not stopped
// if a build is in progress, syntax check is not started
// if a syntax check is in progress it is restarted
// in all other cases, a syntax check is started immediately
// this can be called either from upload() or from the frontend (via SocketManager)
export function checkSyntax(data: any){
if(!data.currentProject)
return;
let project : string = data.currentProject;
if (processes.syntax.get_status()){
if (processes.build.get_status()){
// do nothing
} else if (processes.syntax.get_status()){
processes.syntax.stop();
processes.syntax.queue(() => processes.syntax.start(project));
} else if (processes.build.get_status()){
processes.build.stop();
processes.build.queue( () => processes.syntax.start(project) );
} else {
processes.syntax.start(project);
}
Expand Down

0 comments on commit 8ab22b7

Please sign in to comment.