       return @_loadingGrammars.push(cb)
 
     @_loadingGrammars = [cb]
-    callbacks = (err)=>
+    callbacks = (err) =>
+      console.log('LOADGRAMMARS: finished loading. unrolling ',@_loadingGrammars)
+      if err
+        console.log(err+''+err.stack)
+
       cbs = @_loadingGrammars
       @_loadingGrammars = true
       while cbs.length

      if !--todo
        cb()

    fs.readdir(dir, (err, files)->
      if err
        return cb(err)
      todo = files.length

      grammarPath = path.join(dir, file)
      # CSON.resolve uses fs.isFileSync we'll have to check it in the next step but only on valid files.
      if CSON.isObjectPath(grammarPath)
        @_registryLoadGrammar(grammarPath,(err)->
          done(err)
        )
    )

  _registryLoadGrammar:(grammarPath,cb)->
    fs.stat(grammarPath,(err,stat)->
      if err
        return cb(err)


        else if stat.isDirectory()
          packageDir = modulePath
        else
          # return with no error at all if i cant find the module dir.
          return cb()


        grammarsDir = path.resolve(packageDir, 'grammars')
        console.log('grammarsDir  --------> ',grammarsDir)
        @_registryLoadGrammarsDir(grammarsDir,cb)

      )

