1

I just switched to Visual Studio 2010 from Visual Studio 2008 and also have ReSharper 6 installed.

When pasting lines into case blocks in switch statements, the lines are not auto indented like they were in Visual Studio 2008. I've tried every setting I could find in Visual Studio and ReSharper with no luck. What setting have I probably missed?

I've tried smart and block indenting, and "Automatically format on paste" is checked.

I also uninstalled ReSharper, and it's still not working. It's something in Visual Studio 2010.

Example inside a switch statement block:

Pasting one line of code when cursor is not in column 1.

dockPanelFilters.Visibility = DockVisibility.Visible;
dockPanelFilters.Dock = DockingStyle.Left;
dockPanelFilters.Dock = DockingStyle.Left;

What I expect to see is:

dockPanelFilters.Visibility = DockVisibility.Visible;
dockPanelFilters.Dock = DockingStyle.Left;
dockPanelFilters.Dock = DockingStyle.Left;

Brain dead simple stuff, and it was working in Visual Studio 2008.

Current settings:

  • Tools/Options/Text Editor/C#/Tabs = smart, 4, insert spaces

  • Tools/Options/Text Editor/C#/Formatting = all checked

  • Tools/Options/Text Editor/C#/Indentation = all checked except Indent open and closed braces

  • Tools/Options/Text Editor/C#/New Lines = all checked

  • Tools/Options/Text Editor/C#/Spacing = only first box checked

  • Tools/Options/Text Editor/C#/Wrapping = only first block checked

 

<UserSettings>
    <ApplicationIdentity version="10.0"/>
    <ToolsOptions>
        <ToolsOptionsCategory name="TextEditor" RegisteredName="TextEditor">
            <ToolsOptionsSubCategory name="CSharp" RegisteredName="CSharp" PackageName="Text Management Package">
                <PropertyValue name="TabSize">4</PropertyValue>
                <PropertyValue name="AutoListMembers">false</PropertyValue>
                <PropertyValue name="IndentStyle">2</PropertyValue>
                <PropertyValue name="HideAdvancedMembers">true</PropertyValue>
                <PropertyValue name="ShowNavigationBar">true</PropertyValue>
                <PropertyValue name="VirtualSpace">false</PropertyValue>
                <PropertyValue name="InsertTabs">false</PropertyValue>
                <PropertyValue name="WordWrapGlyphs">true</PropertyValue>
                <PropertyValue name="EnableLeftClickForURLs">true</PropertyValue>
                <PropertyValue name="ShowLineNumbers">false</PropertyValue>
                <PropertyValue name="WordWrap">false</PropertyValue>
                <PropertyValue name="IndentSize">4</PropertyValue>
                <PropertyValue name="CutCopyBlankLines">true</PropertyValue>
                <PropertyValue name="AutoListParams">false</PropertyValue>
            </ToolsOptionsSubCategory>
            <ToolsOptionsSubCategory name="CSharp-Specific" RegisteredName="CSharp-Specific" PackageName="Visual C# Language Service Package">
                <PropertyValue name="NewLines_QueryExpression_EachClause">1</PropertyValue>
                <PropertyValue name="Space_Normalize">0</PropertyValue>
                <PropertyValue name="Space_AroundBinaryOperator">1</PropertyValue>
                <PropertyValue name="Formatting_TriggerOnPaste">1</PropertyValue>
                <PropertyValue name="UnboundItem_ExactMatches">5</PropertyValue>
                <PropertyValue name="GenerateConstructorSmartTagEnabled">1</PropertyValue>
                <PropertyValue name="CompleteOnSpace">1</PropertyValue>
                <PropertyValue name="WarnWhenMembersCauseCompilerGeneratedReferences">1</PropertyValue>
                <PropertyValue name="CollapseInactiveBlocksOnOpen">1</PropertyValue>
                <PropertyValue name="Watson_MaxExceptionsToReport">1</PropertyValue>
                <PropertyValue name="EditAndContinueReportEnterBreakStateFailure">1</PropertyValue>
                <PropertyValue name="TrackMostRecentlyUsed">1</PropertyValue>
                <PropertyValue name="FilterKeywordsContextually">1</PropertyValue>
                <PropertyValue name="BringUpOnSpace">1</PropertyValue>
                <PropertyValue name="Rename_Preview">1</PropertyValue>
                <PropertyValue name="EncapsulateField_PreviewReferenceChanges">1</PropertyValue>
                <PropertyValue name="DelayBeforeShowingErrors">1500</PropertyValue>
                <PropertyValue name="CollapseRegionBlocksOnOpen">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_Method">1</PropertyValue>
                <PropertyValue name="HighlightReferences">0</PropertyValue>
                <PropertyValue name="RefactorNotifyRenameEnabled">1</PropertyValue>
                <PropertyValue name="OnlyScanFirstTypeInFileForDesignerAttribute">0</PropertyValue>
                <PropertyValue name="Indent_CaseLabels">1</PropertyValue>
                <PropertyValue name="Formatting_TriggerOnBlockCompletion">1</PropertyValue>
                <PropertyValue name="CompletionCommitCharacters">{}[]().,:;+-*/%&amp;|^!~=&lt;&gt;?@#'"\</PropertyValue>
                <PropertyValue name="EditAndContinueEnabled">1</PropertyValue>
                <PropertyValue name="InsertNewlineOnEnterWithWholeWord">0</PropertyValue>
                <PropertyValue name="BringUpOnOverride">1</PropertyValue>
                <PropertyValue name="CodeDefinitionWindow_DocumentationComment_IndentOffset">2</PropertyValue>
                <PropertyValue name="Rename_Comments">0</PropertyValue>
                <PropertyValue name="Squiggles_SemanticAnalysis">0</PropertyValue>
                <PropertyValue name="NewLines_Braces_ControlFlow">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_AnonymousMethod">1</PropertyValue>
                <PropertyValue name="Space_WithinOtherParentheses">0</PropertyValue>
                <PropertyValue name="BringUpOnIdentifier">1</PropertyValue>
                <PropertyValue name="RemoveParameters_PreviewReferenceChanges">1</PropertyValue>
                <PropertyValue name="Wrapping_KeepStatementsOnSingleLine">0</PropertyValue>
                <PropertyValue name="Space_AfterBasesColon">1</PropertyValue>
                <PropertyValue name="Indent_Braces">0</PropertyValue>
                <PropertyValue name="CompleteOnNewline">1</PropertyValue>
                <PropertyValue name="EncapsulateField_UpdateAllReferences">0</PropertyValue>
                <PropertyValue name="Wrapping_IgnoreSpacesAroundVariableDeclaration">0</PropertyValue>
                <PropertyValue name="Space_WithinMethodCallParentheses">0</PropertyValue>
                <PropertyValue name="Space_AfterCast">0</PropertyValue>
                <PropertyValue name="Colorize">1</PropertyValue>
                <PropertyValue name="EditAndContinueReportOpenScopeFailure">0</PropertyValue>
                <PropertyValue name="FilterToAllowableTypes">1</PropertyValue>
                <PropertyValue name="SortUsings_PlaceSystemFirst">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_CollectionInitializer">0</PropertyValue>
                <PropertyValue name="Watson_DeferSendingUntilLater">0</PropertyValue>
                <PropertyValue name="ShowKeywords">1</PropertyValue>
                <PropertyValue name="ShowSnippets">1</PropertyValue>
                <PropertyValue name="BraceMatchingRectangle">1</PropertyValue>
                <PropertyValue name="NewLines_AnonymousTypeInitializer_EachMember">1</PropertyValue>
                <PropertyValue name="NewLines_Keywords_Catch">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_ObjectInitializer">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_ArrayInitializer">0</PropertyValue>
                <PropertyValue name="Space_WithinExpressionParentheses">0</PropertyValue>
                <PropertyValue name="Space_InControlFlowConstruct">1</PropertyValue>
                <PropertyValue name="Formatting_TriggerOnStatementCompletion">1</PropertyValue>
                <PropertyValue name="CodeDefinitionWindow_DocumentationComment_WrapLength">80</PropertyValue>
                <PropertyValue name="NewLines_Keywords_Finally">1</PropertyValue>
                <PropertyValue name="Space_BetweenEmptyMethodDeclarationParentheses">0</PropertyValue>
                <PropertyValue name="Indent_UnindentLabels">1</PropertyValue>
                <PropertyValue name="SmartTagEnabled">1</PropertyValue>
                <PropertyValue name="SortUsings">1</PropertyValue>
                <PropertyValue name="Rename_Strings">0</PropertyValue>
                <PropertyValue name="NewLines_ObjectInitializer_EachMember">1</PropertyValue>
                <PropertyValue name="NewLines_Keywords_Else">1</PropertyValue>
                <PropertyValue name="TimeSliceForQuickSearchCaching">50</PropertyValue>
                <PropertyValue name="EnableProgressDialogOnWaitForBackground">1</PropertyValue>
                <PropertyValue name="Space_WithinMethodDeclarationParentheses">0</PropertyValue>
                <PropertyValue name="Space_BetweenEmptyMethodCallParentheses">0</PropertyValue>
                <PropertyValue name="Space_BeforeSemicolonsInForStatement">0</PropertyValue>
                <PropertyValue name="Space_BeforeComma">0</PropertyValue>
                <PropertyValue name="Space_AfterMethodCallName">0</PropertyValue>
                <PropertyValue name="Space_AfterComma">1</PropertyValue>
                <PropertyValue name="ExtractInterface_SelectAll">0</PropertyValue>
                <PropertyValue name="ReorderParameters_PreviewReferenceChanges">1</PropertyValue>
                <PropertyValue name="Wrapping_IgnoreSpacesAroundBinaryOperators">0</PropertyValue>
                <PropertyValue name="Space_BeforeBasesColon">1</PropertyValue>
                <PropertyValue name="Space_AfterMethodDeclarationName">0</PropertyValue>
                <PropertyValue name="Space_AfterDot">0</PropertyValue>
                <PropertyValue name="UnboundItemSmartTagEnabled">1</PropertyValue>
                <PropertyValue name="AutoComment">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_Type">1</PropertyValue>
                <PropertyValue name="Space_AfterLambdaArrow">1</PropertyValue>
                <PropertyValue name="ImplementInterfaceSmartTagEnabled">1</PropertyValue>
                <PropertyValue name="BringUpOnPartial">1</PropertyValue>
                <PropertyValue name="CodeDefinitionWindow_DocumentationComment_IndentBase">1</PropertyValue>
                <PropertyValue name="EncapsulateField_SearchInStrings">0</PropertyValue>
                <PropertyValue name="TimeSliceForQuickSearchSearching">50</PropertyValue>
                <PropertyValue name="EnterOutliningModeOnOpen">0</PropertyValue>
                <PropertyValue name="NewLines_Braces_LambdaExpressionBody">1</PropertyValue>
                <PropertyValue name="Space_WithinSquares">0</PropertyValue>
                <PropertyValue name="Space_BeforeLambdaArrow">1</PropertyValue>
                <PropertyValue name="ShowHiddenItems">0</PropertyValue>
                <PropertyValue name="Squiggles">0</PropertyValue>
                <PropertyValue name="NewLines_Braces_AnonymousTypeInitializer">1</PropertyValue>
                <PropertyValue name="Space_WithinCastParentheses">0</PropertyValue>
                <PropertyValue name="Space_AfterSemicolonsInForStatement">1</PropertyValue>
                <PropertyValue name="Indent_CaseContents">1</PropertyValue>
                <PropertyValue name="Indent_FlushLabelsLeft">0</PropertyValue>
                <PropertyValue name="Watson_ReportExceptions">1</PropertyValue>
                <PropertyValue name="GenerateStubSmartTagEnabled">1</PropertyValue>
                <PropertyValue name="BringUpOnEventHookup">1</PropertyValue>
                <PropertyValue name="ImplementInterface_InsertRegionTags">0</PropertyValue>
                <PropertyValue name="Wrapping_PreserveSingleLine">1</PropertyValue>
                <PropertyValue name="Space_BetweenEmptySquares">0</PropertyValue>
                <PropertyValue name="Space_BeforeOpenSquare">0</PropertyValue>
                <PropertyValue name="Space_BeforeDot">0</PropertyValue>
                <PropertyValue name="Indent_BlockContents">1</PropertyValue>
                <PropertyValue name="RenameSmartTagEnabled">1</PropertyValue>
                <PropertyValue name="ColorizeBoundTypes">1</PropertyValue>
                <PropertyValue name="RemoveUnusedUsings">1</PropertyValue>
                <PropertyValue name="Rename_Overloads">0</PropertyValue>
                <PropertyValue name="EncapsulateField_SearchInComments">0</PropertyValue>
                <PropertyValue name="Refactoring_Verification_Enabled">0</PropertyValue>
                <PropertyValue name="ProgressDialogDelaySeconds">2</PropertyValue>
            </ToolsOptionsSubCategory>
        </ToolsOptionsCategory>
    </ToolsOptions>
</UserSettings>
CharithJ
  • 46,289
  • 20
  • 116
  • 131
P a u l
  • 7,805
  • 15
  • 59
  • 92

4 Answers4

0

You might try setting 'Indent Case Contents'. It is in Options -> Text Editor -> C# -> Formatting -> Indentation.

By the way, you can always press Ctrl + K, D after you have pasted, to format your pasted code correctly.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Edwin de Koning
  • 14,209
  • 7
  • 56
  • 74
  • Do you have resharper 6 installed? The indentation setting is not working for me. I may just uninstall resharper 6 and see what that does, should have done that already. – P a u l Sep 13 '11 at 15:13
0

Auto formatting does not work if there are any syntax errors. Make sure there are no syntax errors once you paste the code. Fix them if there is any, and then this should work.

Just tested your code and it works fine for me on Visual Studio 2010. Below are my settings on

Tools -> Options -> Text Editor -> C# -> Formatting -> General

Enter image description here

You said...

Tools/Options/Text Editor/C#/Spacing = only first box checked

Tools/Options/Text Editor/C#/Wrapping = only first block checked

I've got different spacing and wrapping settings. Probably something may be wrong here in your settings, because this works perfect for me.

Enter image description here

Enter image description here

Enter image description here

I think there is an error once you paste your code. In that case, I can replicate your issue. Keep in mind auto formatting works only when there are no errors.

I just imported your settings and tried. If you paste your code within curly brackets in the case, it automatically formats correctly. If there are no curly brackets, it does not auto format correctly.

switch (taskNumber)
{
    case 1:
    {
        // If you paste your code here. Within curly brackets, it automatically formats correctly.
    }
}

switch (taskNumber)
{
    case 1:
        // If you paste your code here. Without curly brackets for the case, it does not automatically formats correctly.
}
Community
  • 1
  • 1
CharithJ
  • 46,289
  • 20
  • 116
  • 131
  • Do you have resharper 6 installed? I have tried your settings and they are not working. – P a u l Sep 13 '11 at 15:10
  • I've installed Resharper 5.1. But this functionality comes from Visual Studio IDE. Are sure there are no any errors once you paste this code in the case? – CharithJ Sep 13 '11 at 23:09
  • Can't use your spacing settings due to personal preference. I have done a repair install of vs2010, didn't help. I've reset the settings and also loaded known good ones. The code has no errors before and after pasting. I've used vs versions for at least 15 years so I more or less know what to expect. This problem is very strange. – P a u l Sep 14 '11 at 03:24
  • @Paul : Is this happen only when Resharper 6 active? Have you tried without Resharper 6? I don't have Resharper6 installed in my machine. But, AFAIK resharper does nothing on auto formatting but may be there is a bug that interrupt VS auto fomatting? – CharithJ Sep 14 '11 at 03:29
  • Yes, I uninstalled resharper6 and no change. I've also looked at my other extensions and add ons. The only extension is nuget, and testdriven and gallio the only add ons. I dread the thought of uninstalling everything and reinstalling vs2010 but might have to try that. – P a u l Sep 14 '11 at 04:17
  • @Paul : That's very strange. I've installed VS2010 in my home computer and office computer. I tried your issue in both computers and it works fine. But it works exactly in your way when their is an error in the switch/case block. – CharithJ Sep 14 '11 at 04:25
  • @Paul : Hope you have installed SP1 for VS2010? I've got Version 10.0.40219.1 SP1Rel – CharithJ Sep 14 '11 at 04:25
  • My version is the same as yours. I'm getting a nag message about extended discussions :+> – P a u l Sep 14 '11 at 04:36
  • I added my settings to my question above. – P a u l Sep 15 '11 at 18:42
  • @ P a u l : Just imported your settings and tried. If you paste your code within curly brackets in the case it automatically formats correctly. If no curly brackets it does not auto format correctly. See edit 4 in my answer. – CharithJ Sep 18 '11 at 04:36
  • I know, I noticed this also. I am just trying to get back to the functionality I had in vs2008. I type a lot of code, so this formatting bug is a pain. – P a u l Sep 19 '11 at 05:04
  • @ Paul : Pasting those 3 lines of code in a Case statement without curly brackets makes an error in the code (at least a warning) because no break or return. As I had mentioned early also, AutoFormat functionality comes with VS does not work properly if there are errors in the code. – CharithJ Sep 19 '11 at 05:07
  • No the case is okay, I was just showing indenting only. I have a better example here. http://social.msdn.microsoft.com/Forums/en/vseditor/thread/56f8a69b-06af-41fe-a1ff-e2cc1e63e3a5. I should award you the points just for all your efforts. – P a u l Sep 19 '11 at 20:06
  • @ Paul : As you have mentioned, "If the code inside the case is within matching braces the indenting is working correctly". So, this is not a wired issue that happens only in your computer. I am also having the same issue and don't think there is a setting to fix this. – CharithJ Sep 19 '11 at 21:43
  • @ Paul : In StyleCop, it gives a style-warning if I don't use braces in case statements. As I remember it's a readability issue. I understand your style is different, however that's the only workaround I could find. – CharithJ Sep 19 '11 at 21:47
0

Others have pointed out that automatic formatting will not work if you have a syntax error in the file, so I assume that this isn't your problem.

Have you tried resetting your VS settings or importing settings from a known good configuration? For those who don't know, you can Import/Export/Reset environment settings via the Import and Export Settings Wizard available from the Tools menu. If nothing else this will help to rule out a problem with your environment's settings.

I've exported my C# Editor settings (which includes settings under the Advanced, Formatting, and IntelliSense nodes) so you can either import them or do a compare if you like:

(if you want to try and import these settings, save the following with a .vssettings extension and import via the wizard)

<UserSettings>
    <ApplicationIdentity version="10.0"/>
    <ToolsOptions>
        <ToolsOptionsCategory name="TextEditor" RegisteredName="TextEditor">
            <ToolsOptionsSubCategory name="CSharp-Specific" RegisteredName="CSharp-Specific" PackageName="Visual C# Language Service Package">
                <PropertyValue name="NewLines_QueryExpression_EachClause">1</PropertyValue>
                <PropertyValue name="Space_Normalize">0</PropertyValue>
                <PropertyValue name="Space_AroundBinaryOperator">1</PropertyValue>
                <PropertyValue name="Formatting_TriggerOnPaste">1</PropertyValue>
                <PropertyValue name="UnboundItem_ExactMatches">5</PropertyValue>
                <PropertyValue name="GenerateConstructorSmartTagEnabled">1</PropertyValue>
                <PropertyValue name="CompleteOnSpace">1</PropertyValue>
                <PropertyValue name="WarnWhenMembersCauseCompilerGeneratedReferences">1</PropertyValue>
                <PropertyValue name="CollapseInactiveBlocksOnOpen">1</PropertyValue>
                <PropertyValue name="Watson_MaxExceptionsToReport">1</PropertyValue>
                <PropertyValue name="EditAndContinueReportEnterBreakStateFailure">1</PropertyValue>
                <PropertyValue name="TrackMostRecentlyUsed">1</PropertyValue>
                <PropertyValue name="FilterKeywordsContextually">1</PropertyValue>
                <PropertyValue name="BringUpOnSpace">1</PropertyValue>
                <PropertyValue name="Rename_Preview">0</PropertyValue>
                <PropertyValue name="EncapsulateField_PreviewReferenceChanges">1</PropertyValue>
                <PropertyValue name="DelayBeforeShowingErrors">1500</PropertyValue>
                <PropertyValue name="CollapseRegionBlocksOnOpen">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_Method">1</PropertyValue>
                <PropertyValue name="HighlightReferences">1</PropertyValue>
                <PropertyValue name="RefactorNotifyRenameEnabled">1</PropertyValue>
                <PropertyValue name="OnlyScanFirstTypeInFileForDesignerAttribute">0</PropertyValue>
                <PropertyValue name="Indent_CaseLabels">1</PropertyValue>
                <PropertyValue name="Formatting_TriggerOnBlockCompletion">1</PropertyValue>
                <PropertyValue name="CompletionCommitCharacters">{}[]().,:;+-*/%&amp;|^!~=&lt;&gt;?@#'"\</PropertyValue>
                <PropertyValue name="EditAndContinueEnabled">1</PropertyValue>
                <PropertyValue name="InsertNewlineOnEnterWithWholeWord">0</PropertyValue>
                <PropertyValue name="BringUpOnOverride">1</PropertyValue>
                <PropertyValue name="CodeDefinitionWindow_DocumentationComment_IndentOffset">2</PropertyValue>
                <PropertyValue name="Rename_Comments">0</PropertyValue>
                <PropertyValue name="Squiggles_SemanticAnalysis">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_ControlFlow">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_AnonymousMethod">1</PropertyValue>
                <PropertyValue name="Space_WithinOtherParentheses">0</PropertyValue>
                <PropertyValue name="BringUpOnIdentifier">1</PropertyValue>
                <PropertyValue name="RemoveParameters_PreviewReferenceChanges">1</PropertyValue>
                <PropertyValue name="Wrapping_KeepStatementsOnSingleLine">1</PropertyValue>
                <PropertyValue name="Space_AfterBasesColon">1</PropertyValue>
                <PropertyValue name="Indent_Braces">0</PropertyValue>
                <PropertyValue name="CompleteOnNewline">1</PropertyValue>
                <PropertyValue name="EncapsulateField_UpdateAllReferences">0</PropertyValue>
                <PropertyValue name="Wrapping_IgnoreSpacesAroundVariableDeclaration">0</PropertyValue>
                <PropertyValue name="Space_WithinMethodCallParentheses">0</PropertyValue>
                <PropertyValue name="Space_AfterCast">0</PropertyValue>
                <PropertyValue name="Colorize">1</PropertyValue>
                <PropertyValue name="EditAndContinueReportOpenScopeFailure">0</PropertyValue>
                <PropertyValue name="FilterToAllowableTypes">1</PropertyValue>
                <PropertyValue name="SortUsings_PlaceSystemFirst">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_CollectionInitializer">0</PropertyValue>
                <PropertyValue name="Watson_DeferSendingUntilLater">0</PropertyValue>
                <PropertyValue name="ShowKeywords">1</PropertyValue>
                <PropertyValue name="ShowSnippets">1</PropertyValue>
                <PropertyValue name="BraceMatchingRectangle">1</PropertyValue>
                <PropertyValue name="NewLines_AnonymousTypeInitializer_EachMember">1</PropertyValue>
                <PropertyValue name="NewLines_Keywords_Catch">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_ObjectInitializer">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_ArrayInitializer">0</PropertyValue>
                <PropertyValue name="Space_WithinExpressionParentheses">0</PropertyValue>
                <PropertyValue name="Space_InControlFlowConstruct">1</PropertyValue>
                <PropertyValue name="Formatting_TriggerOnStatementCompletion">1</PropertyValue>
                <PropertyValue name="CodeDefinitionWindow_DocumentationComment_WrapLength">80</PropertyValue>
                <PropertyValue name="NewLines_Keywords_Finally">1</PropertyValue>
                <PropertyValue name="Space_BetweenEmptyMethodDeclarationParentheses">0</PropertyValue>
                <PropertyValue name="Indent_UnindentLabels">1</PropertyValue>
                <PropertyValue name="SmartTagEnabled">1</PropertyValue>
                <PropertyValue name="SortUsings">1</PropertyValue>
                <PropertyValue name="Rename_Strings">0</PropertyValue>
                <PropertyValue name="NewLines_ObjectInitializer_EachMember">1</PropertyValue>
                <PropertyValue name="NewLines_Keywords_Else">1</PropertyValue>
                <PropertyValue name="TimeSliceForQuickSearchCaching">50</PropertyValue>
                <PropertyValue name="EnableProgressDialogOnWaitForBackground">1</PropertyValue>
                <PropertyValue name="Space_WithinMethodDeclarationParentheses">0</PropertyValue>
                <PropertyValue name="Space_BetweenEmptyMethodCallParentheses">0</PropertyValue>
                <PropertyValue name="Space_BeforeSemicolonsInForStatement">0</PropertyValue>
                <PropertyValue name="Space_BeforeComma">0</PropertyValue>
                <PropertyValue name="Space_AfterMethodCallName">0</PropertyValue>
                <PropertyValue name="Space_AfterComma">1</PropertyValue>
                <PropertyValue name="ExtractInterface_SelectAll">0</PropertyValue>
                <PropertyValue name="ReorderParameters_PreviewReferenceChanges">1</PropertyValue>
                <PropertyValue name="Wrapping_IgnoreSpacesAroundBinaryOperators">0</PropertyValue>
                <PropertyValue name="Space_BeforeBasesColon">1</PropertyValue>
                <PropertyValue name="Space_AfterMethodDeclarationName">0</PropertyValue>
                <PropertyValue name="Space_AfterDot">0</PropertyValue>
                <PropertyValue name="UnboundItemSmartTagEnabled">1</PropertyValue>
                <PropertyValue name="AutoComment">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_Type">1</PropertyValue>
                <PropertyValue name="Space_AfterLambdaArrow">1</PropertyValue>
                <PropertyValue name="ImplementInterfaceSmartTagEnabled">1</PropertyValue>
                <PropertyValue name="BringUpOnPartial">1</PropertyValue>
                <PropertyValue name="CodeDefinitionWindow_DocumentationComment_IndentBase">1</PropertyValue>
                <PropertyValue name="EncapsulateField_SearchInStrings">0</PropertyValue>
                <PropertyValue name="TimeSliceForQuickSearchSearching">50</PropertyValue>
                <PropertyValue name="EnterOutliningModeOnOpen">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_LambdaExpressionBody">1</PropertyValue>
                <PropertyValue name="Space_WithinSquares">0</PropertyValue>
                <PropertyValue name="Space_BeforeLambdaArrow">1</PropertyValue>
                <PropertyValue name="ShowHiddenItems">0</PropertyValue>
                <PropertyValue name="Squiggles">1</PropertyValue>
                <PropertyValue name="NewLines_Braces_AnonymousTypeInitializer">1</PropertyValue>
                <PropertyValue name="Space_WithinCastParentheses">0</PropertyValue>
                <PropertyValue name="Space_AfterSemicolonsInForStatement">1</PropertyValue>
                <PropertyValue name="Indent_CaseContents">1</PropertyValue>
                <PropertyValue name="Indent_FlushLabelsLeft">0</PropertyValue>
                <PropertyValue name="Watson_ReportExceptions">1</PropertyValue>
                <PropertyValue name="GenerateStubSmartTagEnabled">1</PropertyValue>
                <PropertyValue name="BringUpOnEventHookup">1</PropertyValue>
                <PropertyValue name="ImplementInterface_InsertRegionTags">0</PropertyValue>
                <PropertyValue name="Wrapping_PreserveSingleLine">1</PropertyValue>
                <PropertyValue name="Space_BetweenEmptySquares">0</PropertyValue>
                <PropertyValue name="Space_BeforeOpenSquare">0</PropertyValue>
                <PropertyValue name="Space_BeforeDot">0</PropertyValue>
                <PropertyValue name="Indent_BlockContents">1</PropertyValue>
                <PropertyValue name="RenameSmartTagEnabled">1</PropertyValue>
                <PropertyValue name="ColorizeBoundTypes">1</PropertyValue>
                <PropertyValue name="RemoveUnusedUsings">1</PropertyValue>
                <PropertyValue name="Rename_Overloads">0</PropertyValue>
                <PropertyValue name="EncapsulateField_SearchInComments">0</PropertyValue>
                <PropertyValue name="Refactoring_Verification_Enabled">0</PropertyValue>
                <PropertyValue name="ProgressDialogDelaySeconds">2</PropertyValue>
            </ToolsOptionsSubCategory>
        </ToolsOptionsCategory>
    </ToolsOptions>
    <Category name="Database Tools" RegisteredName="Database Tools"/>
</UserSettings>
RoccoC5
  • 4,185
  • 16
  • 20
0

I can share that experience with you. Indenting problem after pastes, is a common mess up at least to me. Not a problem without solution, though.

I go for select the actual code I wan't to indent, then shortcut CTRL+K+F. A simple remove 'n re-type of the end bracket also fix the identing. Not a autoformatted-paste but still no need to of manual indenting.

Independent
  • 2,924
  • 7
  • 29
  • 45