Skip to content

Commit

Permalink
Show compilation status in webview.
Browse files Browse the repository at this point in the history
  • Loading branch information
agrawal-d committed Jul 8, 2020
1 parent 7e4239f commit 2066630
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/runs/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Language } from '../types';
import { spawn } from 'child_process';
import path from 'path';
import { getSaveLocationPref } from '../preferences';
import { extensionToWebWiewMessage } from '../webview';

/**
* Get the location to save the generated binary in. If save location is
Expand Down Expand Up @@ -65,6 +66,9 @@ const getFlags = (language: Language, srcPath: string): string[] => {
*/
export const compileFile = (srcPath: string): Promise<boolean> => {
console.log('Compilation Started');
extensionToWebWiewMessage({
command: 'compiling-start',
});
ocHide();
const language: Language = getLanguage(srcPath);
if (language.skipCompile) {
Expand All @@ -86,9 +90,15 @@ export const compileFile = (srcPath: string): Promise<boolean> => {
ocShow();
console.error('Compilation failed');
resolve(false);
extensionToWebWiewMessage({
command: 'compiling-stop',
});
return;
}
console.log('Compilation passed');
extensionToWebWiewMessage({
command: 'compiling-stop',
});
resolve(true);
return;
});
Expand Down

0 comments on commit 2066630

Please sign in to comment.