question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[folding] configure initial collapse state

See original GitHub issue

Maybe I missed something … I recently migrated my javascript project from netbeans to visual studio code … in netbeans we use

//<editor-fold defaultstate="collapsed" desc="MySection">
...
//</editor-fold>

for defining regions … I saw I could modify javascript-language-configuration.json to

	"folding": {
		"markers": {
			"start": "^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))",
			"end": "^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))"
		}
	}

SO my request includes 2 questions :

  1. Is it possible to add the editor fold tag to the javascript language configuration (Identical as the configuration for java)
  2. Could a defaultstate be added to regions, so when a file is opened regions will be either collapsed or expanded

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:63
  • Comments:26 (8 by maintainers)

github_iconTop GitHub Comments

191reactions
jabacchettacommented, Jan 7, 2019

Would love to have import blocks automatically folded in files with a simple user setting.

16reactions
aeschlicommented, Jul 20, 2021

Yes, you need Version: 1.59.0-insider Commit: b805d2e94937976bb17d0439f57fcd3a9d423c31 Date: 2021-07-20T05:13:38.717Z

and you need to set "editor.foldingImportsByDefault": true

I tried it with Java and got it working. But yes, it’s not yet tested well. For now, it will be off by default. Please file separate issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Folding | IntelliJ IDEA Documentation - JetBrains
Use this page to specify the default code folding settings. For shortcuts on how to expand or collapse code elements, refer to the...
Read more >
Collapse - Bootstrap
If you've set the collapsible element to be open by default using the show class, set aria-expanded="true" on the control instead. The plugin...
Read more >
Bootstrap collapse initial state - CodePen
HTML ; class · "btn btn-primary collapsed" ; data-toggle · "collapse" ; href · "#collapseExample" ; role · "button" ; aria-expanded · "false" ......
Read more >
Collapse or expand parts of a document - Microsoft Support
To collapse or expand all the headings in your document, right-click the heading and click Expand/Collapse > Expand All Headings or Collapse All...
Read more >
How do I collapse sections of code in Visual Studio Code for ...
There are new folding actions to collapse source code regions based on their folding level. There are actions to fold level 1 (...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found