I've noticed nested classes sometimes cause trouble for intellisense. In the example below intellisense will sometimes show, and sometimes not when typing in a nested reference. To try it out check out this example:
Program TestClassVariable Class Wheel Define Size As Decimal Define PSI As Decimal End Class Class Car Define Make As String Define Model As String Define Year As Integer Define Wheels As Wheel[4] End Class Class Garage Define Cars As Car[3] End Class Method Main() Define g As Garage // g.Cars[1].Wheels[1].PSI = 32 End Method End Program
In the Main routine, try to type in the statement that has been commented out, allowing Intellisense to show its lists at each period. On my system, the nested lists sometimes show, and sometimes do not show. If I hit Backspace after a no-show and retype the period, it again may show, or may not.
Does anyone else see this happening?
I' ve noticed that before too. As far as I can tell it only happens when Phrogram's auto error checker sees something it doesn't like ( an incomplete variable name, etc ) and underlines it in red. This happens when I start typing a line and pause before it is complete.
To work around it I backspace, wait for the checker to remove the red underline ( it does this when it starts checking again ), and type the period before the checker has time to underline my code. This works most of the time, but sometimes it doesn't remove the underline and I have to re-type the entire line of code before intellisense pops up.
Bug?
Dragon Rider is correct, if there are errors in the code them its possible that intellisense won't work. The code has to be parsed as a whole to get intellisense right.
However if it happens where there are no errors its a bug.
I can repro your issue and based on what I see its related to the error scenario.
You type
g.Cars[1]
and pause... the background compiler sees that as an error [not a valid statement] and underlines it. When you type the period its in an error stte and intellises doesn't parse. But notice that after you type the period and wait a litte the 'error' moves to the . [syntax error on line 22] and if you backspace and retype the . then that error doesn't break the intellisense. If you backspace and wait for the red underline to go back to [not a valid statement] then intellisense again fails to work.
So I think I can explain why it does it, but its clearly not how its supposed to work so I'll add it as a bug and look at it for 3.0. The edior has been replaced by a newer version so possibly its gone already.