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 4a454a1

Browse files
author
Dean Sofer
committed
Starting to upgrade
1 parent 86c2ecf commit 4a454a1

File tree

2 files changed

+6
-37
lines changed

2 files changed

+6
-37
lines changed

‎main.js

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ define(function (require, exports, module) {
88

99
// Brackets modules
1010
var MultiRangeInlineEditor = brackets.getModule("editor/MultiRangeInlineEditor").MultiRangeInlineEditor,
11-
FileIndexManager = brackets.getModule("project/FileIndexManager"),
11+
ProjectManager = brackets.getModule("project/ProjectManager"),
1212
EditorManager = brackets.getModule("editor/EditorManager"),
13-
DocumentManager = brackets.getModule("document/DocumentManager"),
14-
JSUtils = brackets.getModule("language/JSUtils"),
15-
PerfUtils = brackets.getModule("utils/PerfUtils"),
1613
NGUtils = require("NGUtils");
1714

1815
var patterns = {
@@ -75,27 +72,10 @@ define(function (require, exports, module) {
7572
* @return {$.Promise} a promise that will be resolved with an array of function offset information
7673
*/
7774
function _findInProject(directiveName, pattern) {
78-
var result = new $.Deferred();
79-
80-
FileIndexManager.getFileInfoList("all")
81-
.done(function (fileInfos) {
82-
PerfUtils.markStart(PerfUtils.ANGULARJS_FIND_DIRECTIVE);
83-
84-
NGUtils.findMatches(pattern, directiveName, fileInfos, true)
85-
.done(function (functions) {
86-
PerfUtils.addMeasurement(PerfUtils.ANGULARJS_FIND_DIRECTIVE);
87-
result.resolve(functions);
88-
})
89-
.fail(function () {
90-
PerfUtils.finalizeMeasurement(PerfUtils.ANGULARJS_FIND_DIRECTIVE);
91-
result.reject();
92-
});
93-
})
94-
.fail(function () {
95-
result.reject();
75+
return ProjectManager.getAllFiles()
76+
.done(function (files) {
77+
return NGUtils.findMatches(pattern, directiveName, files, true);
9678
});
97-
98-
return result.promise();
9979
}
10080

10181
/**
@@ -115,7 +95,6 @@ define(function (require, exports, module) {
11595
}
11696

11797
var result = new $.Deferred();
118-
PerfUtils.markStart(PerfUtils.ANGULARJS_INLINE_CREATE);
11998

12099
var response = helper();
121100
if (response.hasOwnProperty("promise")) {
@@ -127,23 +106,19 @@ define(function (require, exports, module) {
127106
// Use QuickEdit search now that we know which file to look at.
128107
var fileInfos = [];
129108
fileInfos.push({name: jumpResp.resultFile, fullPath: resolvedPath});
130-
// JSUtils.findMatchingFunctions(directiveName, fileInfos, true)
131109
NGUtils.findMatches(pattern, directiveName, fileInfos, true)
132110
.done(function (functions) {
133111
if (functions && functions.length > 0) {
134112
var jsInlineEditor = new MultiRangeInlineEditor(functions);
135113
jsInlineEditor.load(hostEditor);
136114

137-
PerfUtils.addMeasurement(PerfUtils.ANGULARJS_INLINE_CREATE);
138115
result.resolve(jsInlineEditor);
139116
} else {
140117
// No matching functions were found
141-
PerfUtils.addMeasurement(PerfUtils.ANGULARJS_INLINE_CREATE);
142118
result.reject();
143119
}
144120
})
145121
.fail(function () {
146-
PerfUtils.addMeasurement(PerfUtils.ANGULARJS_INLINE_CREATE);
147122
result.reject();
148123
});
149124

@@ -154,21 +129,17 @@ define(function (require, exports, module) {
154129
var jsInlineEditor = new MultiRangeInlineEditor(functions);
155130
jsInlineEditor.load(hostEditor);
156131

157-
PerfUtils.addMeasurement(PerfUtils.ANGULARJS_INLINE_CREATE);
158132
result.resolve(jsInlineEditor);
159133
} else {
160134
// No matching functions were found
161-
PerfUtils.addMeasurement(PerfUtils.ANGULARJS_INLINE_CREATE);
162135
result.reject();
163136
}
164137
}).fail(function () {
165-
PerfUtils.finalizeMeasurement(PerfUtils.ANGULARJS_INLINE_CREATE);
166138
result.reject();
167139
});
168140
}
169141

170142
}).fail(function () {
171-
PerfUtils.finalizeMeasurement(PerfUtils.ANGULARJS_INLINE_CREATE);
172143
result.reject();
173144
});
174145

@@ -215,6 +186,4 @@ define(function (require, exports, module) {
215186

216187
// init
217188
EditorManager.registerInlineEditProvider(provider);
218-
PerfUtils.createPerfMeasurement("ANGULARJS_INLINE_CREATE", "AngularJS Inline Editor Creation");
219-
PerfUtils.createPerfMeasurement("ANGULARJS_FIND_DIRECTIVE", "AngularJS Find Directive");
220189
});

‎package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"title": "AngularJS for Brackets",
44
"description": "AngularJS extension for Brackets by the AngularUI team",
55
"homepage": "https://github.com/angular-ui/AngularJS-brackets",
6-
"version": "1.0.1",
6+
"version": "1.1.0",
77
"author": "AngularUI (http://angular-ui.github.io)",
88
"license": "MIT",
99
"engines": {
10-
"brackets": ">=0.24.0"
10+
"brackets": ">=0.34.0"
1111
}
1212
}

0 commit comments

Comments
(0)

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