Reputation: 227
When I create a type definition in a typescript file (.ts) I am not given the option to collapse the definition in VS Code. For example:
export type Test = {
someValue: string,
someOtherValue: string,
yetAnotherValue: string
};
I don't get the option in the left margin to collapse this definition. Is there a setting that I'm missing to allow this? Does an extension like prettier have the ability to add this? I have been unable to find a solution so my current workaround is to put a region around it.
Upvotes: 2
Views: 639
Reputation: 51
Ctrl + Shift + P
Preferences: Open settings(JSON)
Add
"[javascript]": {
"editor.foldingStrategy": "indentation"
},
"[javascriptreact]": {
"editor.foldingStrategy": "indentation"
},
"[typescript]": {
"editor.foldingStrategy": "indentation"
},
"[typescriptreact]": {
"editor.foldingStrategy": "indentation"
}
Upvotes: 4