0

I am working with Visual Studio Code to create react native apps. To get a better overview of my code, I would like to collapse specific code blocks. But I want to be able to decide where and what to collapse. For this, it would be really nice if a custom comment combination would trigger a folding button on the sidebar.

For example, if I write //- instead of only // at the beginning of a line it should add a collapse button on that line. Is this (or something similar) possible in Visual Studio Code?

JoeBe
  • 1,064
  • 1
  • 8
  • 22

1 Answers1

0

Look at code folding by regions. See How do I collapse sections of code in Visual Studio Code for Windows?.

But I don't think you can alter the region syntax to whatever you want, it is defined by the language configuration.

Try // #region and // #endregion for javascript react. (or //#region and //#endregion)

Mark
  • 97,651
  • 19
  • 297
  • 324