Closed Bug 1581641 Opened 5 years ago Closed 4 years ago

Enable codemirror's code folding in editor mode

Categories

(DevTools :: Console, enhancement, P3)

enhancement

Tracking

(firefox81 fixed)

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: Harald, Assigned: rich)

References

(Blocks 1 open bug)

Details

User Story

When editing longer code, I want to fold unimportant parts, so that I can focus the limited space on the code I am actually editing.

Attachments

(1 file)

No description provided.

To whom it may concern, If someone else picks this up before me I would LOVE to pair with you on it. I've been thinking a lot about this feature and would really enjoy helping or picking up the feature. I may try and take a stab at it soon, if I can wrap my current bug. TBD!

Hello Richard,

I'd gladly mentor you for this bug! Let me know if I should assign you the bug.
This is where we disable the code folding in the console: devtools/client/webconsole/components/Input/JSTerm.js#252
So here we should do like for lineNumbers, on the next line: set it to the value of the editor mode prop.
Then we need to update the option when the user switch from inline to editor mode. Again, we already do that for lineNumbers, so we can adapt it to enableCodeFolding.

With those 2 changes, we could then write a test to make sure the folding is enabled in editor mode, and isn't in inline mode, as well as making sure that when the user switches from editor to inline, with some collapsed code, the code isn't collapsed anymore.

Let me know what you think!

Flags: needinfo?(hello)

Thanks Nicolas – I'd love to work with you to get this conquered. Let me spend this weekend hopefully finishing the other bug I'm working on at the moment, and then I'd like to pick this bug up to get started on next week. Work for you? Excited for this one!

Flags: needinfo?(hello)

Hey Nicolas – I'm back in action and I'd love to move forward with this bug if you're still open to mentoring me! If that works, please assign me the bug and I'll start digging into the source and see what's what. Thanks!

Flags: needinfo?(nchevobbe)

It's your Richard :) Let me know if you have any question!

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

Adding code folding to console when in editor mode.

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5a2cf7ed7079
Enable codemirror's code folding in editor mode r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Blocks: 1658452
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: