var Watcher = require('large-watcher');


module.exports = function(codebox) {
    var events = codebox.events;

    codebox.logger.log("Starting the file watcher");

    codebox.workspace.path()
    .then(function(path) {
        var watcher = Watcher(path, 2).start();

        // Handle deleted files
        watcher.on('deleted', function(files) {
            codebox.events.emit('fs:deleted', files);
        });

        // Handle modified files
        watcher.on('modified', function(files) {
            codebox.events.emit('fs:modified', files);
        });

        // Handle created files
        watcher.on('created', function(files) {
            codebox.events.emit('fs:created', files);
        });

        // Handler errors
        watcher.on('error', function(err) {
            codebox.logger.error(err);
        });

        codebox.logger.log("File watcher started");
    });

};

@@ -168,94 +168,54 @@
     
-codebox.workspace.path()%0A    .then(function(path) %7B%0A        var watcher = Watcher(path
+var watcher = Watcher(codebox.workspace.root()
 , 2)
@@ -221,28 +221,24 @@
 ).start();%0A%0A
-    
     // Handl
@@ -245,36 +245,32 @@
 e deleted files%0A
-    
     watcher.on('
@@ -297,36 +297,32 @@
 iles) %7B%0A        
-    
 codebox.events.e
@@ -339,36 +339,32 @@
 leted', files);%0A
-    
     %7D);%0A%0A       
@@ -352,36 +352,32 @@
 );%0A    %7D);%0A%0A    
-  
-  
 // Handle modifi
@@ -377,36 +377,32 @@
  modified files%0A
-    
     watcher.on('
@@ -422,36 +422,32 @@
 nction(files) %7B%0A
-    
         codebox.
@@ -473,36 +473,32 @@
 ified', files);%0A
-    
     %7D);%0A%0A       
@@ -482,36 +482,32 @@
 iles);%0A    %7D);%0A%0A
-    
     // Handle cr
@@ -518,28 +518,24 @@
 d files%0A    
-  
-  
 watcher.on('
@@ -558,28 +558,24 @@
 on(files) %7B%0A
-    
         code
@@ -612,20 +612,16 @@
 files);%0A
-    
     %7D);%0A
@@ -617,28 +617,24 @@
 );%0A    %7D);%0A%0A
-    
     // Handl
@@ -643,20 +643,16 @@
  errors%0A
-    
     watc
@@ -687,28 +687,24 @@
 ) %7B%0A        
-  
-  
 codebox.logg
@@ -718,20 +718,16 @@
 r(err);%0A
-    
     %7D);%0A
@@ -727,20 +727,16 @@
    %7D);%0A%0A
-    
     code
@@ -775,20 +775,11 @@
 rted%22);%0A
-    %7D);%0A%0A
 %7D;%0A

Use workspace.root() instead of workspace.path()