[atl-1433][atl-1433] improve local sketchbook explorer (#446)

This commit is contained in:
Francesco Stasi
2021-07-21 15:48:15 +02:00
committed by GitHub
parent 4e6f9ae75d
commit 4da5d573e4
6 changed files with 287 additions and 43 deletions

View File

@@ -48,23 +48,11 @@ export class SketchbookTreeWidget extends FileTreeWidget {
@postConstruct()
protected async init(): Promise<void> {
super.init();
this.toDispose.push(
this.arduinoPreferences.onPreferenceChanged(({ preferenceName }) => {
if (preferenceName === 'arduino.sketchbook.showAllFiles') {
this.updateModel();
}
})
);
this.updateModel();
// cache the current open sketch uri
const currentSketch = await this.sketchServiceClient.currentSketch();
this.currentSketchUri = (currentSketch && currentSketch.uri) || '';
}
async updateModel(): Promise<void> {
return this.model.updateRoot();
}
protected createNodeClassNames(node: TreeNode, props: NodeProps): string[] {
const classNames = super.createNodeClassNames(node, props);