diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/PscIde.js | 8 |
1 files changed, 7 insertions, 1 deletions
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) { | |||
139 | }) | 139 | }) |
140 | .then(compileMessages => { | 140 | .then(compileMessages => { |
141 | if (res.resultType === 'error') { | 141 | if (res.resultType === 'error') { |
142 | if (res.result.some(item => item.errorCode === 'UnknownModule' || item.errorCode === 'UnknownName')) { | 142 | if (res.result.some(item => { |
143 | const isUnknownModule = item.errorCode === 'UnknownModule'; | ||
144 | |||
145 | const isUnknownModuleImport = item.errorCode === 'UnknownName' && /Unknown module/.test(item.message); | ||
146 | |||
147 | return isUnknownModule || isUnknownModuleImport; | ||
148 | })) { | ||
143 | debug('unknown module, attempting full recompile') | 149 | debug('unknown module, attempting full recompile') |
144 | return Psc.compile(psModule) | 150 | return Psc.compile(psModule) |
145 | .then(() => PsModuleMap.makeMap(options.src).then(map => { | 151 | .then(() => PsModuleMap.makeMap(options.src).then(map => { |