Closed Bug 1648017 Opened 4 years ago Closed 4 years ago

bracket completion gone on highlight text

Categories

(DevTools :: Console, defect, P2)

Desktop
All
defect

Tracking

(firefox80 fixed)

RESOLVED FIXED
Firefox 80
Tracking Status
firefox80 --- fixed

People

(Reporter: lolipopplus, Assigned: nchevobbe)

Details

Attachments

(1 file)

What were you doing?

  1. open console
  2. input in the following sequences:
    var a = 'ss Enter
    ...a
  3. use shift+home or mouse to highlight ...a and input a bracket [, at this second, ...a is highlight and you have a pair of []
  4. now press enter

What happened?

Console throws error: SyntaxError: expected expression, got '...'

What should have happened?

Was was the expected result? ("Not crashing" may be a valid answer.)

Anything else we should know?

Console should writes Array [ "s", "s" ]

Hello lolipopplus!
So this is actually a feature, and seeing your description, I'd say a confusing one.
When you highlight code in the console and evaluate, only the selected part will be evaluated.
This is something we added when we introduced the editor mode, where it fits well.
But I agree that in "regular" mode, it can be confusing (+ make you lose the input you wrote, minus the text selection)
I think it would be safer to remove this feature from the regular mode (and it wouldn't be hard to do so)

Severity: -- → S4
Priority: -- → P2

This feature is great in editor mode, but can be confusing in in-line mode.
In inline mode, the input is cleared when you evaluate, so if you wrongfully
evaluated only a text selection, you may lose the whole input, and have to
type it again.
This patch disable the feature in inline mode, and modifies the existing test
so we make sure that this work as expected in both editor and inline mode.

Assignee: nobody → nchevobbe
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0c46bbf31f57
Disable console text-selection only evaluation in in-line mode. r=Honza.
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: