vscode-explicit-folding icon indicating copy to clipboard operation
vscode-explicit-folding copied to clipboard

Can this help me get invisible comments?

Open icetbr opened this issue 3 years ago • 5 comments

Hi there, given this code

class A {
    /**
     * The Name
     */
    name,

    /** The Age  */
    age,
}

I want to get as close as possible to

class A {
    name,
    age,
}

I'd appreciate any ideas. Thanks.

icetbr avatar Apr 30 '22 23:04 icetbr

Try:

"explicitFolding.rules": {
    "*": [
        {
            "begin": "/*",
            "end": "*/",
            "nested": false,
            "kind": "comment",
        },
    ],
},

You will be able to fold as:

class A {
    /**
    name,

    /** The Age  */
    age,
}

daiyam avatar May 01 '22 04:05 daiyam

I can get this without the extension, it's VsCode's default behavior.

icetbr avatar May 01 '22 11:05 icetbr

There is no way to completely hide a block of code/comment.

daiyam avatar May 01 '22 12:05 daiyam

Maybe, but I can get pretty close, if only I could get the new line regexes right.

{
  "separator": ",",
},
class A {
  /**...
  name,...
  age,
}

icetbr avatar May 01 '22 13:05 icetbr

Another idea, if you desire to have this as a feature, just return the folding region as line -= 1. Then I would get something like this

class A {...
    name,...
    age,
}

icetbr avatar May 23 '22 00:05 icetbr