From f36d261dcd2ba6afc811da20056cc3941e7f0e9e Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 29 Jan 2021 18:40:33 +0100 Subject: [PATCH] [debug]: No `await` for the watcher in sketchbook. This seems to block the workspace init on Windows in bundled electron. Signed-off-by: Akos Kitta --- arduino-ide-extension/src/node/sketches-service-impl.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arduino-ide-extension/src/node/sketches-service-impl.ts b/arduino-ide-extension/src/node/sketches-service-impl.ts index d4bc11a5..2e8266cb 100644 --- a/arduino-ide-extension/src/node/sketches-service-impl.ts +++ b/arduino-ide-extension/src/node/sketches-service-impl.ts @@ -195,7 +195,12 @@ export class SketchesServiceImpl implements SketchesService { } } }); - await watcher.start(); + + // TODO: no `await` for some reason this blocks the workspace root initialization on Windows inside a bundled electron app. + watcher.start() + .then(() => console.log(`Initialized NSFW in sketchbook: '${sketchbookPath}. Watching for sketch changes.`)) + .catch(err => console.error(`Failed to initialize NSFW in sketchbook '${sketchbookPath}'. Cannot track sketch changes.`, err)); + deferred.resolve(sketches); this.sketchbooks.set(sketchbookPath, sketches); return sketches;