#Visual studio format document settings not being respected code#
The first group of tab settings allow you to change the way that indentation is added automatically when you press Enter within a code editor. Other languages and Visual Studio versions will appear similar.
The image below shows the settings for the C# programming language in Visual Studio 2005. Expand the Text Editor section in the tree and then the language for which you wish to change settings. To access the tab settings, open the Options dialog box by selecting Options from the Tools menu. You can use different settings for each of the supported languages. Visual Studio helps to address these problems by allowing you to configure the manner in which text is indented. You may elect to use only spaces to remove this problem but this can unnecessarily increase the file size, especially with languages that use lots of indentation, such as XML. However, as the width of a tab can vary according to the user's preferences, indentation may appear differently when code is viewed by two developers. In other languages tabs and spaces can be used freely to align code for readability. In some languages white space is significant and can change the meaning of the code if used incorrectly. The type of indentation used for a language can have varied effects. Indentation in Visual Studio is controlled with the use of the tab key, which can be used to insert tab characters or spaces into the code or to indent or unindent selected lines. Sensible use of indentation in source code can greatly improve the readability of the code. This article describes the available options and their usage. Visual Studio provides several configuration options that control the insertion of tab and space characters. Indentation is essential to ensure that source code is easy to read.