In VS Code we have to use following syntax to section out a region:
// #region
content relevant to this region
// #endregion
But for IntelliJ it's as follows:
// region
content relevant to this region
// endregion
(Above code snippets are from JavaScript)
Anyone knows a common pattern to use which will support in both IDEs ?
Apparently //#region
and //#endregion
work for both? Not sure if that applies to all languages. I assume you're working with JS/TS?
If that ends up giving you lint warnings for some linter, that might be solvable. Ex. For ESLint, see ESLint: how to spaced-comment exceptions on VSCode folding regions comments.
As for finding out what region folding comments work in VS Code, that can depend on what language support extensions you are using, and what exactly they implement. VS Code comes with some builtin, but language extensions can add their own (see FoldingRangeProvider
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With