Closed Bug 1512400 Opened 9 months ago Closed 5 months ago

Make console autocomplete optional

Categories

(DevTools :: Console, enhancement, P3)

63 Branch
enhancement

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: watilin, Assigned: dhruvibutti9477, Mentored)

References

Details

(Keywords: good-first-bug)

Attachments

(1 file, 4 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0




Expected results:

Since there are many autocomplete systems, and since they can’t all work the same fashion, completion is not perfectly predictable, and thus might actually impede the user instead of helping them.
Most IDEs– and Firefox’ CSS editor as well –allow to disable autocomplete. The console should do the same.
should we only make auto-autocomplete optional and keep the ability to ask for the autocompletion by doing ctrl+space?
I think we can start having that with a pref, and then exposes it in the UI somehow.
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true

For this bug, we should first create a preference in devtools/client/preferences/devtools-client.js#286 :

pref("devtools.webconsole.input.autocomplete", true);

Then, the preference needs to be retrieved and passed to the components. We can add a JSTERM_AUTOCOMPLETE constant here devtools/client/webconsole/constants.js#71 .
Then we can inject the value to the PrefState here devtools/client/webconsole/store.js#51,58.

Once we have the preference in the state, we get it in devtools/client/webconsole/webconsole-wrapper.js#318,327 and pass it to the App component.

In devtools/client/webconsole/components/App.js#244, we can then pipe it to JsTerm.

Finally, in _inputEventHandler devtools/client/webconsole/components/JSTerm.js#802 , we should check the value of the autocomplete pref before calling autocompleteUpdate:

if (this.lastInputValue !== value) {
  this.resizeInput();
  if (this.props.autocompletePref) { // that's what need to be added.
    this.props.autocompleteUpdate();
  }
  this.lastInputValue = value;
}
Mentor: nchevobbe

I'm an Outreachy applicant. My I take on this bug? Thank you.

Hello msmichelletung, thank you for offering help!
I assigned the bug to you.

You can read http://docs.firefox-dev.tools/getting-started/ to setup the work environment. Make sure to select Artifact builds when asked to, as it's much faster.
Feel free to ask any question, either here or on our Slack :)

Assignee: nobody → msmichelletung
Status: NEW → ASSIGNED

Hello Michelle, how is this going on? Is there anything blocking you?

Flags: needinfo?(msmichelletung)

Hello Nicholas. I’ve been really sick and haven’t been able to work on this bug. Feel free to assign it to someone else if they want to work on it. Sorry for the delay.

Flags: needinfo?(msmichelletung)

Sure! Hope you'll be better.

Status: ASSIGNED → NEW
Assignee: msmichelletung → nobody

Passing on to Dhruvi as discussed on Slack

Assignee: nobody → dhruvibutti9477
Status: NEW → ASSIGNED

Thank you! For assigning it to me.

Priority: -- → P3

Summary : This makes autocomplete for console optional.

Summary : This makes autocomplete for console optional.

Summary : This makes autocomplete for console optional.

Update

Summary : This makes autocomplete for console optional.

Update

Bug 1512400-Make console autocomplete optional.r=nchevobbe

Summary : This makes autocomplete for console optional.

Update

Update

Attachment #9052521 - Attachment is obsolete: true

Summary : This makes autocomplete for console optional.

Attachment #9053257 - Attachment description: Bug 1512400-Make console autocomplete optional.r=nchevobbe → Bug 1512400 - Make console autocomplete optional. r=nchevobbe.
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b6e4c464290c
Make console autocomplete optional. r=nchevobbe.
Attachment #9052531 - Attachment is obsolete: true
Attachment #9051983 - Attachment is obsolete: true
Attachment #9051670 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
You need to log in before you can comment on or make changes to this bug.