Page MenuHomePhabricator

Collapse tags, especially refs in CodeMirror
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):
Would be great to highlight start/end tag of refs and collapse them in code. Possibly also any other tags that have start/end tag (so not for <br>, <nowiki /> etc).

To my understanding this can be done in CodeMirror (already done for templates in T30684).

Maybe you could add this shortcuts:

  • CTRL + ALT + "<" ("," in reality) -- fold all tags.
  • CTRL + ALT + ">" ("." in reality) -- unfold all tags.
  • CTRL + SHIFT + "<" -- fold all selected tags.
  • CTRL + SHIFT + ">" -- unfold all selected tags.

So much like for templates which kind of use "{" "}" keys.
For MacOS instead of CTRL.
BTW. icon is a bad icon for CTRL (Control). "^" is an actual key on SHIFT+6. You should just use <kbd>Ctrl</kbd> which is on most keyboards.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

  1. Fold all refs in an article to make it more readable.
  2. Fold some divs on a main page to easily find a section to modify.

Benefits (why should this be implemented?):
For any editors using CodeMirror

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1104704 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/CodeMirror@master] codeFoldingExtension: fold extension tags

https://gerrit.wikimedia.org/r/1104704

MusikAnimal renamed this task from Collapse tags, especially refs in code editor to Collapse tags, especially refs in CodeMirror.Dec 18 2024, 5:25 AM
MusikAnimal updated the task description. (Show Details)

Change #1104704 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] codeFoldingExtension: fold extension tags

https://gerrit.wikimedia.org/r/1104704

Bhsd moved this task from Feature requests to Done on the MediaWiki-extensions-CodeMirror board.