Bug 38753 - Web Inspector: Autocompletion in console is not usable because it is not add to the entered text the common prefix of suggestions.
Summary: Web Inspector: Autocompletion in console is not usable because it is not add ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2010-05-07 08:28 PDT by Ilya Tikhonovsky
Modified: 2010-05-08 06:20 PDT (History)
4 users (show)

See Also:

[patch] Initial version. (4.21 KB, patch)
2010-05-07 08:41 PDT, Ilya Tikhonovsky
timothy: review-
Details | Formatted Diff | Diff
screencast (435.12 KB, application/octet-stream)
2010-05-07 08:42 PDT, Ilya Tikhonovsky
no flags Details
[patch] second iteration. (4.26 KB, patch)
2010-05-07 09:28 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Tikhonovsky 2010-05-07 08:28:15 PDT
As example if you entered $0.getE then getElementByClassName will be suggested as gray text.
If you press tab then getElementByClassName be suggested again and lementByClassName becomes selected as black text with selection background.
Really after pressing the TAB the next suggestion should be selected (getElementByTagName) and only flexible part of suggestions should be selected.
In this case it should be TagName because getElementBy is the common part for all getE prefix suggestions.
Comment 1 Ilya Tikhonovsky 2010-05-07 08:41:48 PDT
Created attachment 55378 [details]
[patch] Initial version.
Comment 2 Ilya Tikhonovsky 2010-05-07 08:42:38 PDT
Created attachment 55379 [details]
Comment 3 Timothy Hatcher 2010-05-07 09:18:47 PDT
Comment on attachment 55378 [details]
[patch] Initial version.

 +                      for (var j = wordPrefixLength; j < lastIndex; ++j)
Need {} around the body, since it is multiline (per style guide.)

 +                      for (var i = 0; i < completions.length; ++i)
Need {} around the body, since it is multiline (per style guide.)

 +                          if (commonPrefix[j] != completion[j]) {

 +                              commonPrefix = commonPrefix.substr(0,j);
Add a space after ",".

Otherwise looks great! Thanks for the screencast.
Comment 4 Ilya Tikhonovsky 2010-05-07 09:28:58 PDT
Created attachment 55384 [details]
[patch] second iteration.

coding style changes.
Comment 5 WebKit Commit Bot 2010-05-08 06:20:33 PDT
Comment on attachment 55384 [details]
[patch] second iteration.

Clearing flags on attachment: 55384

Committed r59025: <http://trac.webkit.org/changeset/59025>
Comment 6 WebKit Commit Bot 2010-05-08 06:20:41 PDT
All reviewed patches have been landed.  Closing bug.