mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
use .value instead of .label to reduce confusion
This commit is contained in:
1 parent
ab0b3728a1
commit
3eee0bef6f
3 files changed
+9
-8
No files matched your search
@@ -339,6 +339,7 @@ define(function (require, exports, module) {
|
||||
var matchResults = $.map(hints, function (hint) {
|
||||
var searchResult = matcher.match(hint.value, query);
|
||||
if (searchResult) {
|
||||
searchResult.value = hint.value;
|
||||
searchResult.guess = hint.guess;
|
||||
if (hint.depth !== undefined) {
|
||||
searchResult.depth = hint.depth;
|
||||
@@ -371,7 +372,7 @@ define(function (require, exports, module) {
|
||||
hints = filterWithQueryAndMatcher(this.ternProperties, matcher);
|
||||
}
|
||||
|
||||
StringMatch.multiFieldSort(hints, { matchGoodness: 0, label: 1 });
|
||||
StringMatch.multiFieldSort(hints, { matchGoodness: 0, value: 1 });
|
||||
} else if ( type.showFunctionType ) {
|
||||
hints = this.getFunctionTypeHint();
|
||||
} else { // identifiers, literals, and keywords
|
||||
@@ -379,7 +380,7 @@ define(function (require, exports, module) {
|
||||
hints = hints.concat(HintUtils.LITERALS);
|
||||
hints = hints.concat(HintUtils.KEYWORDS);
|
||||
hints = filterWithQueryAndMatcher(hints, matcher);
|
||||
StringMatch.multiFieldSort(hints, { matchGoodness: 0, depth: 1, builtin: 2, label: 3 });
|
||||
StringMatch.multiFieldSort(hints, { matchGoodness: 0, depth: 1, builtin: 2, value: 3 });
|
||||
}
|
||||
|
||||
if (hints.length > MAX_DISPLAYED_HINTS) {
|
||||
@@ -417,7 +418,7 @@ define(function (require, exports, module) {
|
||||
fnHint = varName + fnHint.substr(2);
|
||||
}
|
||||
}
|
||||
hints[0] = {label:fnHint, positions:[]};
|
||||
hints[0] = {value:fnHint, positions:[]};
|
||||
}
|
||||
return hints;
|
||||
};
|
||||
|
||||
@@ -125,7 +125,7 @@ define(function (require, exports, module) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$hintObj.text(token.label);
|
||||
$hintObj.text(token.value);
|
||||
}
|
||||
|
||||
$hintObj.data("token", token);
|
||||
@@ -278,7 +278,7 @@ define(function (require, exports, module) {
|
||||
*/
|
||||
JSHints.prototype.insertHint = function ($hintObj) {
|
||||
var hint = $hintObj.data("token"),
|
||||
completion = hint.label,
|
||||
completion = hint.value,
|
||||
cursor = session.getCursor(),
|
||||
token = session.getToken(cursor),
|
||||
query = session.getQuery(),
|
||||
|
||||
@@ -111,7 +111,7 @@ define(function (require, exports, module) {
|
||||
counter = 0;
|
||||
|
||||
for (counter; counter < hintList.length; counter++) {
|
||||
if (hintList[counter].data("token").label === hint) {
|
||||
if (hintList[counter].data("token").value === hint) {
|
||||
index = counter;
|
||||
break;
|
||||
}
|
||||
@@ -221,7 +221,7 @@ define(function (require, exports, module) {
|
||||
_waitForHints(hintObj, function (hintList) {
|
||||
expect(hintList).not.toBeNull();
|
||||
expectedHints.forEach(function (expectedHint, index) {
|
||||
expect(hintList[index].data("token").label).toBe(expectedHint);
|
||||
expect(hintList[index].data("token").value).toBe(expectedHint);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -236,7 +236,7 @@ define(function (require, exports, module) {
|
||||
function findHint(hintList, hintSelection) {
|
||||
for (var i = 0, l = hintList.length; i < l; ++i) {
|
||||
var current = hintList[i].data("token");
|
||||
if (hintSelection === current.label) {
|
||||
if (hintSelection === current.value) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user