473,383 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Problem with indentation when inserting snippet

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
Jun 2 '07 #1
2 1512
On Fri, 01 Jun 2007 23:59:20 -0700, Rotsey
<ma***********@RemoveThis.optusnet.com.auwrote:
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
Jun 2 '07 #2
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!
Aug 7 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

147
by: Sateesh | last post by:
Hi, I am a beginner in Python, and am wondering what is it about the indentation in Python, without which python scripts do not work properly. Why can't the indentation not so strict so as to give...
0
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since...
29
by: Joseph Haig | last post by:
I am trying to use descriptive lists, <DL>, as shown in <http://www.maths.man.ac.uk/~jhaig/tmp/test.html> with a style sheet at <http://www.maths.man.ac.uk/~jhaig/tmp/default-2.css>. With Mozilla...
2
by: Dave | last post by:
I'm crossposting this to both comp.lang.c++ and gnu.gcc because I'm not sure if this is correct behavior or not, and I'm using the gcc STL and compiler. When calling vector<int>::push_back(0),...
2
by: New | last post by:
Why does this code insert a node into a binary search tree correctly? If I only inserting going by first digit it works properly but when I try inserting going by the whole ip and the port number...
5
by: Mike | last post by:
Why does this code insert a node into a binary search tree correctly? If I only inserting going by first digit it works properly but when I try inserting going by the whole ip and the port number...
12
by: ishtar2020 | last post by:
Hi everybody I've been writing my very first application in Python and everything is running smoothly, except for a strange problem that pops up every once in a while. I'm sure is the kind of...
8
by: Red | last post by:
If auto-format is turned off in VS2008, there is apparently no way to indent a line. Under Tools->Options->Text Editor->C#->Formatting, there are three checkboxes. Unchecking those seems to cause...
28
by: Gandalf | last post by:
every time I switch editor all the script indentation get mixed up, and python start giving me indentation weird errors. indentation also hard to follow because it invisible unlike brackets { }...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.