     window.lupaEntities = files.reduce (res,f) ->
         res.concat(f.metadata)
     ,[]
+    if dashboard
+        dashboard.setFiles(files, addLabelDecoration) # TODO remove addLabelDecoration from here. This is hack
 
     atom.notifications.addSuccess("#{files && files.length} files have been indexed.")
     document.getElementById('lupa-index-project-wrapper').style.display = 'none';

    if !filename
        return

    if debug
        safeToRun = editor.buffer.getText().match(/\/\/ safe to run/)
        if safeToRun
            require.cache[editor.buffer.file.path] = null
            try
                result = require(editor.buffer.file.path)
            catch e
                result = e
        else
            result = '???'
        block = document.createElement('div')
        block.innerHTML = result
        #block.src = 'http://localhost:8000'
        block.width = '100%'
        block.height = '900px'
        #block.style.height = (15 * 5) + 'px';

        range = new Range([0, 0], [0, 0])
        if previewMarker
            previewMarker.destroy()
        previewMarker = editor.markScreenPosition([0, 0]) #editor.markBufferRange(range)
        decoration = editor.decorateMarker(previewMarker, {item:block, type: 'block', position: 'before'})



    update = (f)->
        if dashboard
            plugin.filterFiles((v) -> v).toArray().subscribe( (files)->
                dashboard.setFiles(files, addLabelDecoration) # TODO remove addLabelDecoration from here. This is hack
            )


        refreshStructure plugin, f, (metadata) ->
            editor.metadata = metadata

            onMouseOut: handleDestroyDecorations,
            entities: entitiesAtPos
        }), statusBar)




