rulururu

post IntelliSense Bug in Visual Studio

April 3rd, 2008

Filed under: C++, Software — Kai @ 7:55 pm

I have been irritated many times when IntelliSense stoped working immediately in the middle of programming. Sometimes the whole IntelliSense quits and at other times only certain sections of code fails to bring up List Members and Parameter Info.

According to Microsoft if there is an incomplete function or other coding error above the location of the insertion point, IntelliSense may be unable to parse the code elements and therefore will not work. It’s recommented to comment out the applicable code to enable IntelliSense again.

I found out that certain lines in my code bring IntelliSense to a stand-still.

Any code in Visual Studio that uses a comma-list to define an array of object constructor parameters will kill IntelliSense for all code following the definition.

This works well:

int iSomeNumbers[] = {4, 14, 1, 44 ,1};
char cWord[] = "test";

’cause it’s just a simple array.

The problem appears when using array definitions that include object constructors to create elements.
IntelliSense gets confused by this and crashes:

Point arPoints[] = {Point(1,4), Point(4,1), Point(4,1), Point(4,1)};

The easiest workaround to keep IntelliSense keep on working proper is to this kinda long winded way:

Point arPoints[4];
    arPoints[0] = Point(1,4);
    arPoints[1] = Point(4,1);
    arPoints[2] = Point(4,1);
    arPoints[3] = Point(4,1);

At least I discoverd in the web that this line messes up IntelliSense:

Point arPoints[] = {Point(1,4), Point(4,1), Point(4,1), Point(4,1)};

This one does not:

Point[] arPoints= {Point(1,4), Point(4,1), Point(4,1), Point(4,1)};

Notice that the array brackets are after the type not the identifier.

Hopefully someone can help determine other situations that cause IntelliSense to fail.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

ruldrurd
Powered by WordPress, Content and Design by Kai Bellmann
Entries (RSS) and Comments (RSS)