Inproper behavior of Outermost parenthesis option under Indent each line relatively to in Visual Studio 2022 17.6.2

Patryk Stepien 0 Reputation points
2023-05-26T20:16:43.62+00:00

I am facing the issue with indentation with Visual Studio 2022 formatting code for second line with group of std::array elements inside of curly braces as below:

constexpr static std::array scalarDataTypes
   {
      uint0_t, uint8_t, uint16_t, uint32_t, uint64_t, sint0_t, sint8_t,
         sint16_t, sint32_t, sint64_t, boolean_t, float_t, double_t
   };

My goal is to get second line with group of std::array elements on the same indent level as in first line as on screenshot below:

constexpr static std::array scalarDataTypes
   {
      uint0_t, uint8_t, uint16_t, uint32_t, uint64_t, sint0_t, sint8_t,
      sint16_t, sint32_t, sint64_t, boolean_t, float_t, double_t
   };

From my understanding setting Outermost parenthesis under Indent each line relatively to (Tools -> Options -> Text Editor -> C/C++ -> Code Style -> Formatting -> Indentation) should solve this behavior, but it doesn't.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
3,139 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
2,889 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AnnaXiu-MSFT 14,901 Reputation points
    2023-05-29T10:23:17.4866667+00:00

    Hi @Patryk Stepien, 

    Welcome to Microsoft Q&A! 

    I tested on my side and was unable to find a setting to change the indentation behavior in C++.

    You can request a feature by selecting “Help” menu > Send Feedback > Suggest a Feature.  

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments