T O P I C R E V I E W |
blkohn |
Posted - Mar 27 2020 : 08:06:50 AM I'm not sure if this has been requested before. I would like to see this functionality to reformat code to follow this. |
5 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Apr 09 2020 : 12:32:14 PM Are you looking for support in C++ or C# or both?
If you are looking for C++, have you turned On:
IDE tools menu -> Options -> Text Editor -> C/C++ -> Formatting -> General -> Enable ClangFormat support
if you have, have you ever used ClangFormat before? Having a look at the page:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
suggests that the following ".clang-format" file, placed in your solutions root directory, should help.
# top level Clang Format file Language: Cpp TabWidth: 4 UseTab: ForContinuationAndIndentation
explained just above:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options |
blkohn |
Posted - Apr 09 2020 : 09:35:13 AM That's a shame to learn. Resharper does this: https://www.jetbrains.com/help/resharper/Reference__Options__Languages__CSharp__Formatting_Style_Tabs_and_Indents.html. I had hoped Visual Assist would as well. |
feline |
Posted - Apr 09 2020 : 05:17:06 AM Generally we try not to get involved with code formatting, because it feels like everyone has their own individual requirements for code formatting, making it a very complex area. This is a good example of this. The idea makes sense, but I don't think I have come across it before. |
blkohn |
Posted - Apr 08 2020 : 4:37:03 PM No, that is not what I mean at all. Perhaps reading this might clarify my request: https://dmitryfrank.com/articles/indent_with_tabs_align_with_spaces
|
feline |
Posted - Mar 27 2020 : 11:46:04 AM You are probably looking for the IDE setting:
IDE tools menu -> Options -> Text Editor -> C/C++ -> Tabs -> Insert spaces IDE tools menu -> Options -> Text Editor -> C/C++ -> Tabs -> Keep tabs
and the IDE commands:
IDE Edit menu -> Advanced -> Tabify Selected Lines IDE Edit menu -> Advanced -> Untabify Selected Lines
VA is happy either way. But be aware that if you are using VA Snippets to insert blocks of text, we will insert them as set, so if they are filled with tabs or spaces that is what we will insert. Just something to be aware of if you encounter unexpected tabs / spaces in your editing. |