Open Bug 1536088 Opened 7 years ago Updated 4 years ago

Autocomplete doesn't work for properties with "." or "["

Categories

(DevTools :: Console, defect, P2)

64 Branch
defect

Tracking

(Not tracked)

People

(Reporter: Oriol, Unassigned, Mentored)

References

Details

Attachments

(2 external files, 6 obsolete files)

Open the console and run var obj = {["a.b"]: 1};.
Then write obj["a, autocomplete suggests obj["a.b"] thanks to bug 1476656.
But then write a dot so that the value becomes obj["a.

Expected: autocomplete still suggests obj["a.b"]
Actual: autocomplete doesn't suggest anything.

Analogous for [ instead of .

Thanks for filing Oriol

Priority: -- → P2

Assigning to Helena as discussed on Slack.

Assignee: nobody → helenaenred
Mentor: nchevobbe
Status: NEW → ASSIGNED

Hi Helena. I noticed that this bug hasn't been touched over the last month. Your submitted a patch, that Nicolas reviewed. Do you need more time to address the review comment? If so, that's fine, just let me know. If you, however, do not plan on working on this bug anymore, let me know too, so we can make it available for others to pick up. Thanks!

Flags: needinfo?(helenaenred)

Unassigning bug so others can pick up where Helena left off.

Assignee: helenaenred → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(helenaenred)

Hi Patrick ,
I would like to work on this issue, if anyone is not working on this.

Hello nightwarriorftw!

I assigned you the bug.
Let me know if you have any questions!

Assignee: nobody → amanv1999
Status: NEW → ASSIGNED
Attachment #9125256 - Attachment is obsolete: true

this is a good start :)
So this is the critical place where we check if we should autocomplete, and if so, if we should reach the server or do it from the cache: https://searchfox.org/mozilla-central/rev/b1e51ad5613ad3d911cf42e3e525885ce2278915/devtools/client/webconsole/actions/autocomplete.js#38-56

So here it could be a good idea to pass input to analyzeInputString , and change the code to not rely on simple regex to make our decisions.
Then, we should also pass the result of the analysis in the action, so we can use it in the reducer https://searchfox.org/mozilla-central/rev/b1e51ad5613ad3d911cf42e3e525885ce2278915/devtools/client/webconsole/reducers/autocomplete.js#108-179

Hope this helps.

Attachment #9125256 - Attachment is obsolete: false

Thanks for this Nicolas. On it :)

Attachment #9125256 - Attachment is obsolete: true
Attachment #9125904 - Attachment is obsolete: true
Attachment #9125908 - Attachment is obsolete: true
Depends on: 1616306
Attachment #9125919 - Attachment is obsolete: true
Attachment #9126502 - Attachment is obsolete: true
Attachment #9135087 - Attachment is obsolete: true

Hello Nicolas,
What do you think we should remove regex and use analyzeInputString or keep it as it i.e using matchProp ? Also you pointed out to fix this case first x={ab: 1} . Now writing x["a and hitting tab is resulting in x["ab"] . I guess we only have a wrong autocomplete left for the case where we type [ inside double quotes. You said it's an issue at the moment with the simple code as well. Please review and let me know when you are free.

The bug assignee didn't login in Bugzilla in the last 7 months.
:nchevobbe, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: amanv1999 → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(nchevobbe)
Flags: needinfo?(nchevobbe)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: