Skip to content

Commit

Permalink
For refresh of tree when data is removed
Browse files Browse the repository at this point in the history
See #605.
  • Loading branch information
DanTup committed Jun 6, 2018
1 parent 4d7a2e8 commit 12f8be0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/views/flutter_outline_view.ts
Expand Up @@ -52,7 +52,7 @@ export class FlutterOutlineProvider implements vs.TreeDataProvider<vs.TreeItem>,
if (editor && isAnalyzable(editor.document)) {
this.activeEditor = editor;
this.flutterOutline = null;

this.refresh(); // Force update (to nothing) while requests are in-flight.
this.analyzer.forceNotificationsFor(editor.document.fileName);
} else {
FlutterOutlineProvider.hideTree();
Expand All @@ -68,9 +68,11 @@ export class FlutterOutlineProvider implements vs.TreeDataProvider<vs.TreeItem>,
return element;
}

public async getChildren(element?: FlutterWidgetItem): Promise<vs.TreeItem[]> {
const outline = element ? element.outline : this.flutterOutline ? this.flutterOutline.outline : null;
const children: vs.TreeItem[] = [];
public async getChildren(element?: FlutterWidgetItem): Promise<FlutterWidgetItem[]> {
const outline = element
? element.outline
: (this.flutterOutline ? this.flutterOutline.outline : null);
const children: FlutterWidgetItem[] = [];
const editor = this.activeEditor;

if (outline) {
Expand Down

0 comments on commit 12f8be0

Please sign in to comment.