Allow triggering autocomplete with "[" character

RESOLVED FIXED in Firefox 64

Status

defect
P1
normal
RESOLVED FIXED
11 months ago
3 months ago

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Tracking

(Depends on 1 bug, Blocks 1 bug)

unspecified
Firefox 64
Dependency tree / graph

Firefox Tracking Flags

(firefox64 fixed)

Details

(Whiteboard: [boogaloo-mvp])

Attachments

(1 attachment)

Assignee

Description

11 months ago
**Steps to reproduce**
1. Open the console
2. Type `window[`


**Expected results**

The autocomplete popup opens and show all the accessible properties on the window object. Selecting an element (e.g. "alert") from the list completes the input to `window["alert"]`.

**Actual results**

The autocomplete popup is not displayed.

---
Assignee

Updated

11 months ago
Blocks: 1458831
Priority: -- → P2
Whiteboard: [boogaloo-mvp]
Assignee

Comment 1

10 months ago
Marking this blocked by Bug 1472117 since we'll need to modify the same functions for this bug.
Depends on: 1472117
Assignee

Updated

10 months ago
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Priority: P2 → P1
Assignee

Updated

10 months ago
Depends on: 1217198
Assignee

Comment 2

9 months ago
This patch adds the ability to open the autocomplete popup when
typing an opening bracket (i.e. `[`]) in the console input.
This impacts a significant amount of function where we assumed
that the only way to get a completion was to use a dot.
We uses the rename `anylyzeInputString` function to get the
completion part from an input, as well as if the user is performing
an element access (i.e., using the bracket).
We then send that information to the webconsole actor, which send
it to the client.
This allows us to rely on a single parse of the input and gives us
access to this information everywhere we need to, be it on the client
or on the server.

We allow the user to type property name without quotes, and we add
them when the user accept an autocompletion.
We also automatically add a closing bracket (i.e. `]`), when it's needed.

Some test are added. On the server side to make sure the actor's autocomplete
function returns what's expected.
We take that as an opportunity to add test for commands.
On the client side, tests are added to ensure the different behavior works
as expected (check the completion text and the input  after accepting
the completion when the user entered some letters, or not, with or without
quotes, with different quotes, hitting the autocomplete cache, …).

A test which accesses the autocomplete cache was modified since the shape
of the cache changed to include the last matchProp as well as the
isElementAccess boolean.
Comment on attachment 9011371 [details]
Bug 1476656 - Trigger autocomplete on bracket; r=Honza.

Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9011371 - Flags: review+

Comment 4

9 months ago
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3ecd0d2e0006
Trigger autocomplete on bracket; r=Honza.

Comment 5

9 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/3ecd0d2e0006
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
Depends on: 1536088
Depends on: 1541422
You need to log in before you can comment on or make changes to this bug.