borsTiHD
borsTiHD

Reputation: 315

Visual Studio Code - How to prevent comment folding

I love folding my code in visual studio code, but I wish I could still see my comment blocks with multiple lines. I use them for my functions and classes. Is there a way to achive this?

For example I have this piece of code:

    /**
    * setMinimize() - Minimize my window
    */
    setMinimize() {
        this.win.minimize()
    }

Now I use folding and the following happens:

    /**...
    setMinimize() {...
    }

Actually, I'd like to achieve this (so I can still see my comment block):

    /**
    * setMinimize() - Minimize my window
    */
    setMinimize() {...
    }

Edit: I forgot to say that I use the option 'fold all', or 'fold level 2'.

Upvotes: 7

Views: 815

Answers (2)

EEzTool
EEzTool

Reputation: 1

I find a way to avoid collasping multiple line comment, you can comment like this:

/* you can */
/* comment */
/* like this */
// #region or
// #region like
// #region this

This may not be a solution, but anyway it works for me. I use ctrl+k ctrl+0 to fold codes.

Upvotes: -1

Wiki
Wiki

Reputation: 222

the comment section will be visible and will not close, if you do formating you code by ctrl+k and ctrl+f and also see this example of code well formated

/*** This code ***/
#seo-card1 canvas,
#seo-card2 canvas {
  height: 150px !important;
  border-bottom-right-radius: 5px;
  border-bottom-left-radius: 5px;
  @media only screen and (max-width: 768px) {
    padding-bottom: 30px;
  }
}

Upvotes: -1

Related Questions