gecko-dev/devtools/shared/webconsole
Nicolas Chevobbe f9b5460bf2 Bug 672733 - Make autocomplete search case insensitive; r=Honza.
This patch adds a smarter heuristic for autocompletion results:
if the input first letter is lowercased, then we'll filter
matching properties case insensitively. But if the user starts
with an uppercase, we assume they know the property they want
and thus respect the casing.
For example: `win` will return both `window` and `Window`, but
`Win` will return `Window` only.
Due to this behavior, we change the order of the autocomplete
results so lowercased property are displayed before the uppercased
one.
If we take are example again, it's likely that if a user type `win`,
they want `window`, but the alphabetical order would return `Window`
first which would annoy user.

Now, since we return results that does not match exactly the user
input, we need to modify the frontend.

Usually, we only show the autocompletion popup if there are
at least 2 matching items, since 1 matching item will still
be displayed using the autocompletion text. But now, since the
input might not match, we want to still display the popup if
there is one matching item, but starts differentely than what
the user entered.
For example, the user typed `window.addeve`, which matches
`addEventListener`. The completion text will make it looks like
it will be completed to `window.addeventListener`, which would
be undefined. So showing the popup with the actual matching
property might avoid some confusion for the user.

A test was added to make sure the frontend works as expected.
Some test cases were added in the server test to make sure
the actor returns expected results. Other tests needed some
adjustement because of the insensitive case matches and the
new order of results.

Differential Revision: https://phabricator.services.mozilla.com/D4061

--HG--
extra : moz-landing-system : lando
2018-08-27 16:08:56 +00:00
..
test Bug 672733 - Make autocomplete search case insensitive; r=Honza. 2018-08-27 16:08:56 +00:00
client.js Bug 1333994 - The network tab should flag resources on the tracking protection list; r=ochameau 2018-08-23 07:36:08 +00:00
js-property-provider.js Bug 672733 - Make autocomplete search case insensitive; r=Honza. 2018-08-27 16:08:56 +00:00
moz.build Bug 1483173 - introduce screenshot actor; r=ochameau 2018-08-27 15:14:10 +00:00
network-helper.js Bug 1479524 - Remove unused appId filter. r=jdescottes 2018-08-16 10:14:50 -07:00
throttle.js Bug 1454696 - Run eslint --fix for prefer-const;r=yulia 2018-06-01 12:36:09 +02:00