From 20666304e01a3aac624cc79d79bcd75c6f381dc5 Mon Sep 17 00:00:00 2001 From: Divyanshu Agrawal Date: Wed, 8 Jul 2020 22:01:18 +0530 Subject: [PATCH] Show compilation status in webview. --- src/runs/compiler.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/runs/compiler.ts b/src/runs/compiler.ts index d684726..1479aee 100644 --- a/src/runs/compiler.ts +++ b/src/runs/compiler.ts @@ -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 @@ -65,6 +66,9 @@ const getFlags = (language: Language, srcPath: string): string[] => { */ export const compileFile = (srcPath: string): Promise => { console.log('Compilation Started'); + extensionToWebWiewMessage({ + command: 'compiling-start', + }); ocHide(); const language: Language = getLanguage(srcPath); if (language.skipCompile) { @@ -86,9 +90,15 @@ export const compileFile = (srcPath: string): Promise => { ocShow(); console.error('Compilation failed'); resolve(false); + extensionToWebWiewMessage({ + command: 'compiling-stop', + }); return; } console.log('Compilation passed'); + extensionToWebWiewMessage({ + command: 'compiling-stop', + }); resolve(true); return; });