Handling Enter differently when devtools.webconsole.input.editor is true
Categories
(DevTools :: Console, task, P1)
Tracking
(firefox69 fixed)
| Tracking | Status | |
|---|---|---|
| firefox69 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: transfusion, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [console-editor-mvp])
Attachments
(1 file, 1 obsolete file)
When the preference is enabled, hitting Enter should create a new line.
Evaluation should be done with Ctrl + Enter (Cmd + Enter on OSX).
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Comment 1•2 years ago
|
||
Depends on D17097
Updated•2 years ago
|
| Reporter | ||
Comment 3•2 years ago
|
||
If someone wants to work on this, they should be able to grab https://phabricator.services.mozilla.com/D17098 which implements what we want.
Then, a test should be added to make sure that hitting Ctrl (or Cmd on OSX) + Enter does execute the input (and Enter does not) when in editor mode.
You can have the JsTerm in editor mode by running firefox with the following: ./mach run --devtools --setpref devtools.webconsole.input.editor=true
To write the test, you can also have a look at what was done in Bug 1519315.
| Reporter | ||
Comment 4•2 years ago
|
||
Erik, as discussed on Slack, I assign you this patch. Feel free to ask any question, either here or on slack
| Reporter | ||
Comment 5•2 years ago
|
||
Hello Eric, how is it going on? Is anything blocking you?
Comment 6•2 years ago
|
||
Yes, couldn't ascertain why the function is not executing and dev tool debugger couldn't help me
| Reporter | ||
Comment 7•2 years ago
|
||
Could you do a screencast and post it here (or on Slack) so we can check what's going on?
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Comment 8•2 years ago
|
||
clearing assignee
| Reporter | ||
Updated•2 years ago
|
| Assignee | ||
Comment 9•2 years ago
|
||
| Assignee | ||
Comment 10•2 years ago
|
||
Summary of the process I went through to fix this bug:
- Modified
JSTerm.jsbased on https://phabricator.services.mozilla.com/D17098 , added lines 953 to 963, as well as a couple lines below that to handle the case where codeMirror is not enabled with the legacy JSTerm. To write the test, you can also have a look at what was done in Bug 1519315.Bug 1519315 is still open, however, Bug 1519313 was relatively similar and I added the mochitests based on that, 2 subtests where the editor is enabled, and 3 where disabled, each run once without codeMirror and once with, thus 10 subtests in total.
I have a question about EventUtils.sendKey and about the testing framework in general, I was looking for a reference to the current "window" since the 2nd argument is function sendKey(aKey, aWindow) {; I looked in other tests and found some usages like toolbox.getCurrentPanel(), however I didn't completely understand what a panel was and how I should get a reference to it, and since we openNewTabAndConsole, only test on the focus console and I saw other tests not including the 2nd argument I decided to leave it out.
Documentation was also a bit sparse especially about some properties on the hud, but through dxr I was able to understand how findMessages and related functions work.
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Updated•2 years ago
|
Comment 11•2 years ago
|
||
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d23b1e5f649c Enter should create a new line, Ctrl-Enter should execute the input when 'devtools.webconsole.input.editor' is true. r=nchevobbe
Comment 12•2 years ago
|
||
| bugherder | ||
Updated•2 years ago
|
Description
•