Bug? IDE unable to find references if line is moved around (syntax coloring is also missing)

Sandman

Expert
Licensed User
Longtime User
This one is a bit difficult to explain. I'll give it a shot. I tend to move things around quite a bit to structure my code better, and I almost always do this using the alt-up/alt-down keys.

I've noticed several times that the syntax coloring tends to get confused when I do this. Sub names etc can be half in correct color, and half in a generic white (I use a dark theme).

Just now I was shuffling around some variables in Globals in an Activity. One of them didn't get the correct syntax coloring (just white, generic), which didn't really bother me. But this time I also wanted to find the references for that specific variable, and the IDE was unable to find any. I thought this to be very strange, I was sure I had used it. I copied it and searched for it instead, and did find it. I tried to find references for the variable just above it - worked fine. Something didn't add up.

So I placed my cursor last on the line of the white variable and pressed return. It got colored correctly, and now I could find references just fine again.

Sorry, no screenshot for this. I tried re-creating the problem, but the IDE kept up with my shuffling this time so no luck. But it happens from time to time.

Let me know if I can provide more info to help nail this down.
 

Sandman

Expert
Licensed User
Longtime User
As it happens, I sort of managed a screenshot showing the confusion of the IDE.

upload_2017-9-13_14-11-47.png


I just changed the order of these lines using alt-up. You can see that the last e in the top variable is white, and the first A in As is yellow. Finding references for the top one displays them for them bottom one, vice versa for the bottom one. The IDE hasn't clued in yet to the fact that I actually moved the lines. And knowing what @Erel will ask next: No, it didn't solve itself after some time. (I waited a couple of minutes.) But adding a return after first line fixed it.
 
Top