Autocomplete randomly stops working

I have an issue with the IDE which is driving me nuts: the autocomplete stops working every now and then and the only way I’m getting it back is through restarting the IDE.

Anybody else noticed this?

Yes. It is annoying.

Very Annoying

happens sometimes. I suspect some errors in my xojo code causes the parser to fail somewhere.

I don’t think it’s so random. In some methods, in just the right case it happens always. I can go back to those sections of code, and auto complete simply doesn’t work.

The code compiles and runs fine, has been for many months. So, not a code issue, just some weird condition that the auto complete engine must not like.

There are areas where autocomplete simply does not work at all. For instance System, which autocompletes only Microeconds and Ticks, and has none of the properties and methods listed at http://documentation.xojo.com/index.php/system

Indeed, a lot of them are missing.

However, it is one thing to not show them at all but it bothers me more when autocomplete is working but items are missing.
For example when creating a class that has methods. When instantiated, sometimes the methods show up in autocomplete, or sometimes they’re just missing in the list. Methods that return Booleans never show up. (As if I added the Hidden attribute.)

Also the other way around. At this moment I’m working on a Canvas subclass. Most of my private computed properties show up in autocomplete while (I think) they shouldn’t.

[quote=231699:@Marco Hof]Also the other way around. At this moment I’m working on a Canvas subclass. Most of my private computed properties show up in autocomplete while (I think) they shouldn’t.

[/quote]
I noticed this too.

System is, for all appearances, a module to you
Unfortunately internally its not
And I dont really want to hack Autocomplete oto fake it
I just need to find the time to move this to actually BE a module and then it will just work along with one or two others

[quote=231699:@Marco Hof]
Also the other way around. At this moment I’m working on a Canvas subclass. Most of my private computed properties show up in autocomplete while (I think) they shouldn’t.[/quote]
Really depends on WHERE this code is
If its in the subclass itself of course they should
If its usage outside the class they shouldn’t
I dont recall if I didn’t just check some code in recently to deal with this
I know I did something like this but it could be a different use case

Here is a mini example: https://dl.dropboxusercontent.com/u/609785/Xojo/Forum/autocomplete.xojo_binary_project

See the Action event of the Pushbutton.

  // aPrivateProperty shows up in autocomplete
  MyCanvas1.aP
  
  // MethodA is not in autocomplete
  MyCanvas1.Me
  
  // Here MethodA IS in autocomplete
  Dim a As String = MyCanvas1.Me
   
  // OverLoad with 9 Methods shows 4 times in the list instead of 1
  MyCanvas1.

(There is another that I couldn’t recreate without copying a lot of code. That method will just never show up in autocomplete.)
Maybe it helps.

This one I may already have fixed for a future release

And it should not be since MethodA returns a value and this isn’t using it so it won’t show
See your next example

As it should be

[quote=231715:@Marco Hof]

  // OverLoad with 9 Methods shows 4 times in the list instead of 1
  MyCanvas1.

Hmmm given the way you wrote those overloads & this code none should show
Again this may be fixed for a future release

A bit since I can see that there are some expectations you have that are incorrect and that there are still some bugs

If you have a FUNCTION (returns a value) and do not use CALL or assign the return result then the function wont show in the list
It requires you do something with the return value via a call or assignment

Some ARE fixed for “a future release”
The only one that still seems to be an issues is the overloads as it should not show any of them (they all return values) but the one returning the string array is still showing but it should not - none should since none are valid
See my explanation about about FUNCTIONS and when you should / should not expect to see them in the autocomplete list

Uff… you are so right. I stand corrected and apologize.
I never realized the autocomplete changed based on if it was a function or a method.

It tries to be smart

The last one with all the overloads does seem to not be handled quite correctly though
I thought I recalled a bug report but could not find it so I filed it to make sure I dont lose track of it
feedback://showreport?report_id=41667

[quote=231730:@Marco Hof]Uff… you are so right. I stand corrected and apologize.
I never realized the autocomplete changed based on if it was a function or a method.[/quote]
That’s fine - I dont think a lot of people realize that it does try to be that context sensitive
But I’m not sure thats what others are saying they’re seeing occur

[quote=231733:@Norman Palardy]That’s fine - I dont think a lot of people realize that it does try to be that context sensitive

But I’m not sure thats what others are saying they’re seeing occur[/quote]
I don’t know about others, but I am sure that I did not confuse public with hidden class members, or functions with methods.

I like the way it works, when it works.

Unfortunately I have not found a reproducable case yet, that is why I used the word “random” in the title and that’s why I have not opened a feedback case on this, yet.

I hope that we soon will get a version of the IDE where search and autocomplete are working in a reliable way, because now it causes a major slowdown.

[quote=231732:@Norman Palardy]
The last one with all the overloads does seem to not be handled quite correctly though
I thought I recalled a bug report but could not find it so I filed it to make sure I dont lose track of it
feedback://showreport?report_id=41667[/quote]
Never mind this one … not a bug either since you might do

Sub MethodThatReturnsAnArray() as String()
end sub

MethodThatReturnsAnArray.Append
Or any other of the valid array manipulators

[quote=231735:@Oliver Osswald]
I hope that we soon will get a version of the IDE where search and autocomplete are working in a reliable way, because now it causes a major slowdown.[/quote]
There are a couple cases that have been reported about search - at least one of which I’ve already fixed for a future release
I thought I saw another reported recently but haven’t looked into it yet

But autocomplete I cant say that I’ve seen it fail to function when working in the IDE
And I do tend to have that open for long periods (sometimes days)
Bugs that are hard to reproduce are problematic because it could be I need your specific set up or your project - or both
While we may not be able to immediately reproduce a problem I would still encourage you to report whatever details you can with whatever you can to help us out. Sometimes several people reporting similar behaviours is clue enough.

But sometimes it isn’t.
Trust me its just as frustrating on this end to not be able to fix something when there are people saying “yeah I’ve seen that” and yet I dont or cannot reproduce it even with detailed steps or samples.

Persistence usually pays off though

[quote=231735:@Oliver Osswald]
I hope that we soon will get a version of the IDE where search[/quote]
Are you referring to 41290 (reported 2015-11-07 ?)
Thats fixed already for a future release
Reported too late to fix for 2015r3.1 a that was shipped 3 days after the report