> I am using VS2005 with C# and when go to insert a snippet
> it is not indenting the code to where my current indent is.
>
> Is this by design or is there a way to have it indent properly???
I have found that usually (maybe always but I haven't figured out for
sure), when there's something that the compiler doesn't like
(extra/missing semicolon, undeclared "using" reference, pretty much
anything that would generate a compilation error), it doesn't mess with
the indentation.
I have also found that once I've fixed the issue, and for some reason
occasionally even if I don't, if I cut and repaste the code just within
the code editor window, VS will get the indentation right the second time
around.
Since I haven't tested that particular issue in a thorough manner, I can't
say for sure what's going on. But you might try doing the cut/paste thing
and see if that helps.
Pete
Jeff - 07 Aug 2007 23:26 GMT
For what it is worth. I had the same problem.
Then it started working once I edited the XML snippet file in VS2005 and let
it do the indentation for me. In other words, inside the Code tag, I just
took the default VS2005 indentation and then when I dropped it in my source
code file, it correctly indented.
don't know why - it just did!