Vlad-Herus / CollapseRegionExtension

MIT License
8 stars 7 forks source link

Tip: Collapsing other region types #6

Open MattTree opened 3 years ago

MattTree commented 3 years ago
  1. Download source.
  2. Find this line:
    if (text.StartsWith("#region", StringComparison.CurrentCultureIgnoreCase))
  3. Add a condition that matches your language. Here's one for C++:
    if (text.StartsWith("#region"       , StringComparison.CurrentCultureIgnoreCase) ||
    text.StartsWith("#pragma region", StringComparison.CurrentCultureIgnoreCase))
  4. Build as a Release version.
  5. Uninstall your current version of CollapseRegionExtension.
  6. Open CollapseRegionExtension.vsix found in bin/Release to install your custom version.
DouglasPHill commented 2 years ago

Awesome thank you, I changed this line if (text.StartsWith("<!--")) to if (text.StartsWith("<!--") || text.StartsWith(@"//"))

dglutting commented 1 year ago

if (text.StartsWith("/*")) { var textLow = text.ToLower(); if (textLow.Contains("#region")) { regions.Add(region);

I added this and built locally. It works for regions inside .css files

/ #region Region Name Here /