Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit d85ea2b

Browse files
author
Dean Sofer
committed
Finishing upgrade
1 parent 0059ad1 commit d85ea2b

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

‎NGUtils.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ define(function (require, exports, module) {
1010
"use strict";
1111

1212
// Load brackets modules
13-
var Async = require("utils/Async"),
14-
DocumentManager = require("document/DocumentManager"),
15-
FileUtils = require("file/FileUtils"),
16-
_ = require("thirdparty/lodash"),
17-
StringUtils = require("utils/StringUtils");
13+
var Async = brackets.getModule("utils/Async"),
14+
DocumentManager = brackets.getModule("document/DocumentManager"),
15+
FileUtils = brackets.getModule("file/FileUtils"),
16+
_ = brackets.getModule("thirdparty/lodash"),
17+
StringUtils = brackets.getModule("utils/StringUtils");
1818

1919
/**
2020
* Function matching regular expression. Recognizes the forms:
@@ -222,17 +222,27 @@ define(function (require, exports, module) {
222222
* contain a map of all function names from the document and each function's start offset.
223223
*/
224224
function _getFunctionsInFiles(fileInfos) {
225-
var docEntries = [];
225+
var docEntries = [],
226+
result = new $.Deferred();
226227

227-
return Async.doInParallel(fileInfos, function (fileInfo) {
228-
return _readFile(fileInfo)
228+
Async.doInParallel(fileInfos, function (fileInfo) {
229+
var oneResult = $.Deferred();
230+
231+
_readFile(fileInfo)
229232
.then(function (docInfo) {
230233
docEntries.push(docInfo);
234+
oneResult.resolve();
231235
}, function (error) {
232236
// If one file fails, continue to search
233-
return;
237+
oneResult.resolve();
234238
});
235-
}).promise();
239+
240+
return oneResult.promise();
241+
}).done(function(){
242+
result.resolve(docEntries);
243+
});
244+
245+
return result.promise();
236246
}
237247

238248
/**
@@ -253,7 +263,7 @@ define(function (require, exports, module) {
253263
if (!keepAllFiles) {
254264
// Filter fileInfos for .js files
255265
jsFiles = fileInfos.filter(function (fileInfo) {
256-
return (/^\.js/i).test(FileUtils.getFilenameExtension(fileInfo.fullPath));
266+
return (/^\.(js|html?)/i).test(FileUtils.getFileExtension(fileInfo.fullPath));
257267
});
258268
} else {
259269
jsFiles = fileInfos;

‎main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ define(function (require, exports, module) {
77
"use strict";
88

99
// Brackets modules
10-
var MultiRangeInlineEditor = require("editor/MultiRangeInlineEditor").MultiRangeInlineEditor,
11-
ProjectManager = require("project/ProjectManager"),
12-
EditorManager = require("editor/EditorManager"),
10+
var MultiRangeInlineEditor = brackets.getModule("editor/MultiRangeInlineEditor").MultiRangeInlineEditor,
11+
ProjectManager = brackets.getModule("project/ProjectManager"),
12+
EditorManager = brackets.getModule("editor/EditorManager"),
1313
NGUtils = require("NGUtils");
1414

1515
var patterns = {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /