-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Convert numbers to strings, so StringMatch can match it. #11484
Conversation
Came across this while writing docs for #11200. Have sent them to you via slack. |
OK, that is serious in that it would break brackets when trying to edit preferences file? |
Run this in brackets console to see what error get produced. var StringMatch = require("utils/StringMatch");
StringMatch.stringMatch(1024, "10", { preferPrefixMatches: true }); Converting 1024 to string works fine. |
Yes it broke hints when I pressed enter. So this fixes that as well. |
Thanks @sprintr . |
@sprintr How often do the users run into this use case? I did not understand the workflow with the |
I don't know any ext using number preference but since brackets supported that even before this feature I believe we should support it here as well. Right now it is broken. |
@sprintr OK! Could you mention the exact repro steps? Let me speak to the team and take an opinion. |
You can copy any number type preference from the wiki page "'Preference code hints for developers". I am on phone so can't give exact steps to repro this |
@@ -281,6 +281,13 @@ define(function (require, exports, module) { | |||
return null; | |||
} | |||
|
|||
// Convert integers to strings, so StringMatch.stringMatch can match it. | |||
if (option.type === "number" || option.valueType === "number") { | |||
values = values.map(function (val) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sprintr use $.map(values, function (val) {
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess raw ES5 should be faster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this. I think the one you have above should work fine.
Convert numbers to strings, so StringMatch can match it.
@nethip Thanks for getting this in. When is the release scheduled? |
@sprintr No issues! Thanks for jumping in and fixing it. Really appreciate it. We are targeting today for doing the release. |
It was nice to get this in time. |
Converts
"number"
values into strings soStringMatch.stringMatch
can match it.@abose This is critical to go with the release.