aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ide.js
diff options
context:
space:
mode:
authoreric thul <thul.eric@gmail.com>2017-04-23 18:17:27 -0400
committereric <thul.eric@gmail.com>2017-04-23 18:20:22 -0400
commit78e2b0d91f5eb98674c5b05db0ef2c4f417581c0 (patch)
treed76942d9da52f7b72747ac2c825b80e8c27b57fb /src/ide.js
parente17196589a380eed3ffc47705f8c6c87f99b58c2 (diff)
downloadpurs-loader-78e2b0d91f5eb98674c5b05db0ef2c4f417581c0.tar.gz
purs-loader-78e2b0d91f5eb98674c5b05db0ef2c4f417581c0.tar.zst
purs-loader-78e2b0d91f5eb98674c5b05db0ef2c4f417581c0.zip
Handle multiple forced compiles on rebuild
Resolves #90
Diffstat (limited to 'src/ide.js')
-rw-r--r--src/ide.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ide.js b/src/ide.js
index ac80789..a2ccbe3 100644
--- a/src/ide.js
+++ b/src/ide.js
@@ -44,7 +44,7 @@ function spawnIdeClient(body, options) {
44 44
45 const stdout = []; 45 const stdout = [];
46 46
47 debug('ide client %s %o %o', ideClientCommand, ideClientArgs, body); 47 debug('ide client %s %o %O', ideClientCommand, ideClientArgs, body);
48 48
49 return new Promise((resolve, reject) => { 49 return new Promise((resolve, reject) => {
50 const ideClient = spawn(ideClientCommand, ideClientArgs); 50 const ideClient = spawn(ideClientCommand, ideClientArgs);
@@ -211,7 +211,7 @@ module.exports.rebuild = function rebuild(psModule) {
211 try { 211 try {
212 const parsed = JSON.parse(response); 212 const parsed = JSON.parse(response);
213 213
214 debugVerbose('parsed JSON response: %o', parsed); 214 debugVerbose('parsed JSON response: %O', parsed);
215 215
216 return Promise.resolve(parsed); 216 return Promise.resolve(parsed);
217 } 217 }
@@ -224,7 +224,7 @@ module.exports.rebuild = function rebuild(psModule) {
224 const result = Array.isArray(parsed.result) ? parsed.result : []; 224 const result = Array.isArray(parsed.result) ? parsed.result : [];
225 225
226 return Promise.map(result, (item, i) => { 226 return Promise.map(result, (item, i) => {
227 debugVerbose('formatting result %o', item); 227 debugVerbose('formatting result %O', item);
228 228
229 return formatIdeResult(item, options, i, result.length); 229 return formatIdeResult(item, options, i, result.length);
230 }).then(formatted => ({ 230 }).then(formatted => ({
@@ -254,7 +254,7 @@ module.exports.rebuild = function rebuild(psModule) {
254 254
255 return isModuleNotFound || isUnknownModule || isUnknownModuleImport; 255 return isModuleNotFound || isUnknownModule || isUnknownModuleImport;
256 })) { 256 })) {
257 debug('failed to rebuild because the module is unknown') 257 debug('module %s was not rebuilt because the module is unknown', psModule.name);
258 258
259 return Promise.reject(new UnknownModuleError()); 259 return Promise.reject(new UnknownModuleError());
260 } 260 }