mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
Find builtin .json files in new location.
Add some logging when we fail to read one of the json files
This commit is contained in:
1 parent
dd6342921e
commit
46365a6e2e
1 file changed
+4
-1
@@ -61,6 +61,7 @@ define(function (require, exports, module) {
|
||||
function initTernServer(dir) {
|
||||
var ternOptions = {
|
||||
environment:ternEnvironment,
|
||||
async:true,
|
||||
getFile: function(name, next) {
|
||||
DocumentManager.getDocumentForPath(dir + name).done(function(document){
|
||||
next(null, document.getText());
|
||||
@@ -74,7 +75,7 @@ define(function (require, exports, module) {
|
||||
* Read in the json files that have type information for the builtins, dom,etc
|
||||
*/
|
||||
function initTernEnv() {
|
||||
var path = module.uri.substring(0, module.uri.lastIndexOf("/") + 1) + "tern/";
|
||||
var path = module.uri.substring(0, module.uri.lastIndexOf("/") + 1) + "tern/defs/";
|
||||
var files = ["ecma5.json"];//, "browser.json", "plugin/requirejs/requirejs.json", "jquery.json"];
|
||||
|
||||
var dirEntry = new NativeFileSystem.DirectoryEntry(path),
|
||||
@@ -83,6 +84,8 @@ define(function (require, exports, module) {
|
||||
files.forEach(function(i) {
|
||||
DocumentManager.getDocumentForPath(path + i).done(function(document){
|
||||
ternEnvironment.push(JSON.parse(document.getText()));
|
||||
}).fail(function(error){
|
||||
console.log("failed to read tern config file " + i);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user