Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2007

Tip: Looking for answers? Try searching our database.

Problem with indentation when inserting snippet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rotsey - 02 Jun 2007 07:59 GMT
Hi,

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???

rotsey
Peter Duniho - 02 Jun 2007 11:01 GMT
> 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!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.