


You might be able to get this behavior using an extension such as CodeRush or ReSharper. The only formatting I see that you might have wanted is to line up the object initializer expression with the declaration but that isn't an option in the VS formatting options AFAIK. We also need to tick Align when multiline. Place the bookmark wherever you want within your code files and then you can move among the book marks using Ctrl B + P, and Ctrl + B +N.

The clang-format style source (CCpp.clangformatstyle) is set to file by default, which reads in a. Place the cursor on the line where you want to put bookmark and press Ctrl+B + T or select the ' Toggle a bookmark in current line ' form the Bookmark Toolbar. This should already be set to Wrap always since we just set that. The C/C++ extension comes with it, though you have the option to specify the path to your own installed version of clang-format on your computer using the option CCpp.clangformatpath. Go to the Wrapping and Braces tab, and find Chained method calls. Start typing the word align to search for it. If it doesn't do anything then format document probably won't either. To do this, we need to go into our code style settings. In general, for a single block of code you can remove and add back a closing curly and/or a semicolon (and save if you have enabled the option) and the editor will reformat that block of code. Hence the format command isn't going to do anything for it. You have lined up your curly braces and indentation inside an initializer expression is not enforced. In your specific case format document won't do anything because it doesn't see anything wrong. It will not however resolve all formatting issues as sometimes there is no valid formatting that makes sense. Format document will format the document based upon the rules that are defined by the VS settings and any applied.
