Data Platform Developer Center > Data Platform Development Forums > XML and the .NET Framework > User defined code folding (region/endregion) for XML?
Ask a questionAsk a question
 

AnswerUser defined code folding (region/endregion) for XML?

  • Wednesday, May 23, 2007 4:47 PMVinay Agarwal Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,
    Is there a way to define custom code folding for XML in Visual Studio? Visual Studio seems to be the best editor for XML (compared to Eclipse plugins and NetBeans) and I use it even when my web project is Java based. The only thing I miss is user defined code folding to manage large XML files. Is there a way?
    Thanks in advance.
    Vinay Agarwal

Answers

All Replies

  • Wednesday, May 23, 2007 10:41 PMStan Kitsis - MSFTMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi Vinay,

     

    You can create custom outline regions in the XML Editor:

    • Select the area you want to outline
    • Select "Hide region" either from the Edit | Outlining menu or right-click | Outlining menu

    Stan Kitsis

  • Wednesday, May 23, 2007 11:20 PMVinay Agarwal Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Stan,

    Thanks for the info. This works for the duration of editing session but doesn't persist over editing sessions like region/endregion in C#. I would prefer to have some way to define regions even if they are simply special comments that are understood by the editor (like Java code folding comments in NetBeans IDE).

    Regards,
    Vinay Agarwal
  • Thursday, May 24, 2007 6:49 PMStan Kitsis - MSFTMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Yes, unfortunately this is the current behavior.  It's one of those really nice to have things that doesn't quite make the list.  We might revisit it, but I can't promise anything.

     

    Stan

  • Monday, March 03, 2008 10:06 AMryanpudd Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Does anyone know if this has been added to Visual Studio 2008?

    Thanks

    Ryan
  • Monday, March 03, 2008 6:29 PMStan Kitsis - MSFTMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi Ryan,

     

    No, this is not in VS 2008.