diff options
author | eric thul <thul.eric@gmail.com> | 2016-11-19 13:12:54 -0500 |
---|---|---|
committer | eric thul <thul.eric@gmail.com> | 2016-11-19 13:12:54 -0500 |
commit | 28124e28f18c5aae38e149a3fc9624b46a906281 (patch) | |
tree | 3fd97f9efa767dbf356f7cd1f079b1694ed49792 /src/PscIde.js | |
parent | 514ab14654d5809c2485455c875471328238d102 (diff) | |
download | purs-loader-28124e28f18c5aae38e149a3fc9624b46a906281.tar.gz purs-loader-28124e28f18c5aae38e149a3fc9624b46a906281.tar.zst purs-loader-28124e28f18c5aae38e149a3fc9624b46a906281.zip |
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.
Diffstat (limited to 'src/PscIde.js')
-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 => { |