title: vsCode refresh tree when adding new Item
body: <p>I use the following code to show tree items,</p>
  
  <p><a href="https://github.com/microsoft/vscode-extension-samples/tree/master/tree-view-sample" rel="nofollow noreferrer">https://github.com/microsoft/vscode-extension-samples/tree/master/tree-view-sample</a></p>
  
  <p>The items which is shown in the tree is related to a file, if the file changed the number of the tree items should be changed accordingly(using <code>createFileSystemWatcher</code> which works ok), currently I’ve add the code of the file watcher and when debug it stops there (on the <code>getChildren</code> function when I'm changing the file) and I see that I’ve provided the <strong>new updated</strong> entries (in the code),however the tree <strong>doesn’t</strong> refreshed with the new data, any idea what am I missing here ?  somehow the new updated data is not reflected in the tree. as I new to this topic maybe I miss something. if the code is OK and there is a bug or this is not supported please let me know.</p>
  
  <pre><code>export class TaskTreeDataProvider implements vscode.TreeDataProvider&lt;TreeItem&gt; {
  
  private _onDidChangeTreeData: vscode.EventEmitter&lt;TreeItem | null&gt; = new vscode.EventEmitter&lt;TreeItem | null&gt;();
    readonly onDidChangeTreeData: vscode.Event&lt;TreeItem | null&gt; = this
      ._onDidChangeTreeData.event;
  
    private eeake: Promise&lt;TreeItem[]&gt; | undefined = undefined;
    private autoRefresh: boolean = true;
  
    constructor(private context: vscode.ExtensionContext) {
      this.autoRefresh = vscode.workspace
        .getConfiguration(“sView")
        .get("autorefresh");
  
      let filePath = this.fileName;
      let fileWatcher = vscode.workspace.createFileSystemWatcher(filePath);
      fileWatcher.onDidChange(() =&gt; (this.eeake = this.getChildren()), this.refresh());
    }
  
    refresh(): void {
      this._onDidChangeTreeData.fire();
    }
  
    public async getChildren(task?: TreeItem): Promise&lt;TreeItem[]&gt; {
      let tasks = await vscode.tasks
        .fetchTasks({ type: “run” })
        .then(function (value) {
          return value;
        });
  
      let entry: TreeItem[] = [];
      if (tasks.length !== 0) {
        for (var i = 0; i &lt; tasks.length; i++) {
          entry[i] = new TreeItem(
            tasks[i].definition.type,
            tasks[i].name,
            {
              command: “sView.executeTask",
              title: "Execute",
              arguments: [tasks[i]]
            }
          );
        }
      }
      return entry;
    }
  
    getTreeItem(task: TreeItem): vscode.TreeItem {
      return task;
    }
  }
  
  
  
  class TreeItem extends vscode.TreeItem {
    type: string;
    constructor(
      type: string,
      label: string,
      collapsibleState: vscode.TreeItemCollapsibleState,
      command?: vscode.Command
    ) {
      super(label, collapsibleState);
      this.type = type;
      this.command = command;
      this.iconPath = getIcon();
    }
  
  }
  
  </code></pre>
  
  <p>If there is something missing please let me know and I add, I'm really stuck with it.</p>
  
  <p>If there is another way to refresh the tree please let me know</p>