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 6f3afa1

Browse files
author
Dean Sofer
committed
Corrected directive name inflection
1 parent 418c622 commit 6f3afa1

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

‎main.js‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ define(function (require, exports, module) {
3737
return null;
3838
}
3939

40-
return token.string;
40+
return token.string.replace(/\-\w/g,function(x){returnx.charAt(1).toUpperCase();});
4141
}
4242

4343
/**
4444
* @private
4545
* For unit and performance tests. Allows lookup by function name instead of editor offset
4646
* without constructing an inline editor.
4747
*
48-
* @param {!string} functionName
48+
* @param {!string} directiveName
4949
* @return {$.Promise} a promise that will be resolved with an array of function offset information
5050
*/
51-
function _findInProject(functionName) {
51+
function _findInProject(directiveName) {
5252
var result = new $.Deferred();
5353

5454
FileIndexManager.getFileInfoList("all")
5555
.done(function (fileInfos) {
5656
PerfUtils.markStart(PerfUtils.ANGULARJS_FIND_DIRECTIVE);
5757

58-
NGUtils.findMatchingDirectives(functionName, fileInfos, true)
58+
NGUtils.findMatchingDirectives(directiveName, fileInfos, true)
5959
.done(function (functions) {
6060
PerfUtils.addMeasurement(PerfUtils.ANGULARJS_FIND_DIRECTIVE);
6161
result.resolve(functions);
@@ -77,11 +77,11 @@ define(function (require, exports, module) {
7777
* For unit and performance tests. Allows lookup by function name instead of editor offset .
7878
*
7979
* @param {!Editor} hostEditor
80-
* @param {!string} functionName
80+
* @param {!string} directiveName
8181
* @return {$.Promise} a promise that will be resolved with an InlineWidget
8282
* or null if we're not going to provide anything.
8383
*/
84-
function _createInlineEditor(hostEditor, functionName) {
84+
function _createInlineEditor(hostEditor, directiveName) {
8585
// Use Tern jump-to-definition helper, if it's available, to find InlineEditor target.
8686
var helper = brackets._jsCodeHintsHelper;
8787
if (helper === null) {
@@ -101,8 +101,8 @@ define(function (require, exports, module) {
101101
// Use QuickEdit search now that we know which file to look at.
102102
var fileInfos = [];
103103
fileInfos.push({name: jumpResp.resultFile, fullPath: resolvedPath});
104-
// JSUtils.findMatchingFunctions(functionName, fileInfos, true)
105-
NGUtils.findMatchingDirectives(functionName, fileInfos, true)
104+
// JSUtils.findMatchingFunctions(directiveName, fileInfos, true)
105+
NGUtils.findMatchingDirectives(directiveName, fileInfos, true)
106106
.done(function (functions) {
107107
if (functions && functions.length > 0) {
108108
var jsInlineEditor = new MultiRangeInlineEditor(functions);
@@ -123,7 +123,7 @@ define(function (require, exports, module) {
123123

124124
} else { // no result from Tern. Fall back to _findInProject().
125125

126-
_findInProject(functionName).done(function (functions) {
126+
_findInProject(directiveName).done(function (functions) {
127127
if (functions && functions.length > 0) {
128128
var jsInlineEditor = new MultiRangeInlineEditor(functions);
129129
jsInlineEditor.load(hostEditor);
@@ -175,12 +175,12 @@ define(function (require, exports, module) {
175175

176176
// Always use the selection start for determining the function name. The pos
177177
// parameter is usually the selection end.
178-
var functionName = _getDirectiveName(hostEditor, sel.start);
179-
if (!functionName) {
178+
var directiveName = _getDirectiveName(hostEditor, sel.start);
179+
if (!directiveName) {
180180
return null;
181181
}
182182

183-
return _createInlineEditor(hostEditor, functionName);
183+
return _createInlineEditor(hostEditor, directiveName);
184184
}
185185

186186
// init

0 commit comments

Comments
(0)

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