I am working with Eclipse tool and I am so curious to know about that how can I create Region
in Eclipse like in Visual Studio
we can create :
#region abc
// Some Code
#endregion abc
How to achieve the same thing in Eclipse.
Eclipse does not have something like Visual Studio's region. but you can use the below code and enable folding for this purpose. You can add a new template like the below in the Prefrences > C/C++ > Templates menu to add it to surround with and code snippet (auto-complete with CTRL+Space)
For instance, you can use #region in Java/JavaScript if you're using Visual Studio Code. check this out There is no way to do this in eclipse.The eclipse ide does not provide a way to region off areas of code like visual studio does I came from visual studio to eclipse and this is a problem I had.
Note, it's not really a feature of C#, but of the Visual Studio as an IDE. For instance, you can use #region in Java/JavaScript if you're using Visual Studio Code.
You can also collapse an outlining region by double-clicking any line in the region on the outlining margin, which appears just to the left of the code. You can see the contents of a collapsed region as a tooltip when you hover over the collapsed region. This topic applies to Visual Studio on Windows.
Got to long for a comment ..
There is code folding in Eclipse. You can find it in Window-> Preferences, then search for "folding". But it just wraps methods/functions/comments etc.
There is a plugin that used to work in Eclipse 4.2 named Coffee Bytes, but it is no longer maintained. So usage is at your own risk.
Lots of "buts", I know ;).
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