Code Snippet & Auto Formatting

Last post 09-18-2007 3:05 AM by sujitm. 1 replies.

Sort Posts:

  • Code Snippet & Auto Formatting

    09-17-2007, 10:35 AM
    • Member
      100 point Member
    • soelinn
    • Member since 02-20-2004, 5:51 PM
    • Posts 33

    Is there a way to specify not to do automatic formatting in Code Snippets?

     

    I created the following code snippet because I like putting these code separator comment lines between methods.
    However, everytime I use this code snippet, it gets auto indented and I always have to delete out the preceding TABs.

    Yes, this is how I want it and it's my coding style.

    1    
    2 <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    3 <CodeSnippet Format="1.0.0">
    4 <Header>
    5 <Title>Code Separator Comment Line</Title>
    6 <Shortcut>sep</Shortcut>
    7 <Description>Code snippet for adding a code separator comment line</Description>
    8 <Author>Soe</Author>
    9 <SnippetTypes>
    10 <SnippetType>Expansion</SnippetType>
    11 </SnippetTypes>
    12 </Header>
    13 <Snippet>
    14 <Code Language="csharp">
    15 ![CDATA[//----------------------------------------------------------------------------------------------------]]>
    16 </Code>
    17 </Snippet>
    18 </CodeSnippet>
    19 </CodeSnippets>

     

     

    namespace MyNameSpace
    {
    public class MyClass
    {
    #region Method: MethodA()
    public void MethodA()
    {
    // do something
    }
    #endregion

    //------------------------------------------------------------------------------------------

    #region Method: MethodB(int, string)
    public void MethodB(int myInt, string myString)
    {
    // do something
    }
    #endregion
    }
    }

     
    Thanks,
    Soe

    Filed under: ,
  • Re: Code Snippet & Auto Formatting

    09-18-2007, 3:05 AM
    Answer
    • Contributor
      3,121 point Contributor
    • sujitm
    • Member since 05-23-2007, 5:01 AM
    • Pune
    • Posts 512

    I don't think there is an option to disable auto formatting only for code snippets. You can disable for it entire code.

    - Sujit

    Dont forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
Page 1 of 1 (2 items)