fix sketch uri issue.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2020-07-21 18:49:23 +02:00
parent e1d86d0bda
commit 230bacfd01
5 changed files with 31 additions and 14 deletions

View File

@@ -80,6 +80,20 @@ export abstract class SketchContribution extends Contribution {
return sketches[0];
}
protected async currentSketchFile(): Promise<string | undefined> {
const sketch = await this.currentSketch();
if (sketch) {
const uri = new URI(sketch.uri).resolve(`${sketch.name}.ino`).toString();
const exists = await this.fileSystem.exists(uri);
if (!exists) {
this.messageService.warn(`Could not find sketch file: ${uri}`);
return undefined;
}
return uri;
}
return undefined;
}
}
export namespace Contribution {