From 28124e28f18c5aae38e149a3fc9624b46a906281 Mon Sep 17 00:00:00 2001 From: eric thul Date: Sat, 19 Nov 2016 13:12:54 -0500 Subject: PscIde full recompile on unknown module imports Instead of forcing a recompile on an unknown value and on unknown module imports, opt to only recompile for unknown module imports. An unknown value may be a typo. Having a faster feedback loop in these cases seems ideal. --- src/PscIde.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/PscIde.js b/src/PscIde.js index b0b56a8..2e105be 100644 --- a/src/PscIde.js +++ b/src/PscIde.js @@ -139,7 +139,13 @@ function rebuild(psModule) { }) .then(compileMessages => { if (res.resultType === 'error') { - if (res.result.some(item => item.errorCode === 'UnknownModule' || item.errorCode === 'UnknownName')) { + if (res.result.some(item => { + const isUnknownModule = item.errorCode === 'UnknownModule'; + + const isUnknownModuleImport = item.errorCode === 'UnknownName' && /Unknown module/.test(item.message); + + return isUnknownModule || isUnknownModuleImport; + })) { debug('unknown module, attempting full recompile') return Psc.compile(psModule) .then(() => PsModuleMap.makeMap(options.src).then(map => { -- cgit v1.2.3