Hook up initial requirejs support.

Sync to new version of tern, which has support for simplified common JS modules, which brackets uses.
Enable the requirejs tern plugin.  Had to modify how we deal with file paths a bit - we were leaving in the leading '/', which made things look like an absolute path, and then tern would view '/test.js' as a different file than 'test.js'.
Some cleanup - add logging for errors from tern, delete some old commented out code.
This commit is contained in:
Erik Tierney committed 2013-04-10 09:49:56 -04:00
1 parent 7d52361aa7
commit 87de92de12
4 files changed
+26 -13

No files matched your search

@@ -66,7 +66,7 @@ define(function (require, exports, module) {
files : files,
env : ternEnvironment
});
rootTernDir = dir;
rootTernDir = dir + "/";
}
/**
@@ -381,6 +381,15 @@ define(function (require, exports, module) {
file:name,
text:document.getText()
});
})
.fail(function(){
// Need to send something back to tern - it will wait
// until all the files have been retrieved before doing its calculations
ternWorker.postMessage({
type:HintUtils.TERN_GET_FILE_MSG,
file:name,
text:""
});
});
}