Autocomplete doesn't work for properties with "." or "["
Categories
(DevTools :: Console, defect, P2)
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 .
Comment 2•7 years ago
|
||
Assigning to Helena as discussed on Slack.
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
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!
Comment 5•7 years ago
|
||
Unassigning bug so others can pick up where Helena left off.
Comment 6•6 years ago
|
||
Hi Patrick ,
I would like to work on this issue, if anyone is not working on this.
Comment 7•6 years ago
|
||
Hello nightwarriorftw!
I assigned you the bug.
Let me know if you have any questions!
Comment 8•6 years ago
|
||
Updated•6 years ago
|
Comment 9•6 years ago
|
||
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.
Updated•6 years ago
|
Comment 10•6 years ago
|
||
Thanks for this Nicolas. On it :)
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 13•6 years ago
|
||
Updated•6 years ago
|
Comment 14•6 years ago
|
||
Updated•6 years ago
|
Comment 15•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 16•6 years ago
|
||
Comment 17•6 years ago
|
||
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.
Comment 18•4 years ago
|
||
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.
Updated•4 years ago
|
Updated•4 years ago
|
Description
•