           #@out("entr")(entry.entries)
           #entry.entries.forEach @listenForEvents
   rebuild:()=>
-
+    @isRebuilding = true
     @hideDirs()
     @hideFiles()
+    # if @mylyn.filterOn
+    #   @view.treeView.roots.forEach (root)=>
+    #       if root.expand
+    #           console.log "EXPAND"
+    #           #root.expand(true)
     @view.treeView.roots.forEach (root)=>@listenForEvents root.directory
     rootDir = @view.treeView.roots[0].directory
-
+    @isRebuilding = false
   getDomFiles: =>$(".tree-view [is='tree-view-file']")
 
 

    @mylyn.filterOn = !@mylyn.filterOn
    if @mylyn.filterOn
      @mylyn.enabled = true
    @reloadTreeView()


module.exports =

      files.each (i,e)=>@hideFile(e)

  listenForEvents:(entry)->
      if entry.onDidExpand&&!@isRebuilding
          entry.onDidExpand((d)=>@rebuild())

      if entry.entries
