none
VS 2015 indenting text inside of #region now

    Question

  • This was not the prior behavior, nor should there be indentations, within "#region" sections of code.  A "#region" is just to be able to collapse code sections and has nothing to do with the code "styling".  Where is the option to turn off "#region" indentation?  Why was this added to VS 2015?
    Wednesday, April 27, 2016 7:32 PM

Answers

  • Thanks for Ashidacchi's reply.

    Hi tymberwyld,

    Which Text Editor do you use?

    According to your description, I create a C# project and use #region in C# Text Editor, the result is the same in both VS2010 and VS2015, both of them are not indented.

    But in VB Text Editor, I get the same result with you. I also search all settings about code styling for VB Text Editor in Tools -> Options -> Text Editor -> Basic, I don't find such settings for #Region. I'm afraid that this is the default design for VB Text Editor.

    I suggest you submit your requirement to Visual Studio Connect and then share the feedback link here. I will vote it and it also benefit to other communities who has the same problem to vote and add comments for your feedback.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 28, 2016 6:10 AM
    Moderator

All replies

  • Hi tymberwyld,

    English is not my native language, and I might misunderstand your comment. If so, please forgive me.

    1. What do you mean by "#Region indentation"?
       A line of "#Region" or "#End Region" is not indented. And lines between "#Region" and "#End Region" are indented automatically (in default), and such line-indentation is the same without "#Region" and "#End Region". 

    2. What do you mean by "styling"?

    3. "#Region" directive has been added before VS 2015. In my poor memory, it has existed in VS 2003 already. 

    Regards.
    Thursday, April 28, 2016 4:44 AM
  • Thanks for Ashidacchi's reply.

    Hi tymberwyld,

    Which Text Editor do you use?

    According to your description, I create a C# project and use #region in C# Text Editor, the result is the same in both VS2010 and VS2015, both of them are not indented.

    But in VB Text Editor, I get the same result with you. I also search all settings about code styling for VB Text Editor in Tools -> Options -> Text Editor -> Basic, I don't find such settings for #Region. I'm afraid that this is the default design for VB Text Editor.

    I suggest you submit your requirement to Visual Studio Connect and then share the feedback link here. I will vote it and it also benefit to other communities who has the same problem to vote and add comments for your feedback.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 28, 2016 6:10 AM
    Moderator