How to make custom style folding comment in vs.code

85 Views Asked by At

I work in typescript, using the "vs code" editor.

I want to group similar functions in // #region myFunctions commentary scope. It's an good future, but, when I collapse this, it's the risk of deleting it accidentally.

How to custom styling for this approach. how to achieve this?

1

There are 1 best solutions below

0
Leo Garsia On

I've found the following solution. I've installed vs code extension "better comments". Then I made the comment // * Mycomment, at the header of the code, which I wanted to make collapsable. Then I select appropriate part of the code and from 'Command Pallete...', choose menu - "Create Manual Folding Range from Selection". That's all. The range header has a custom style, different from the usual comment, and if even I accidentally will delete this line, it doesn't affect the collapsed code range.