The IDE does not auto-complete once operator_lookup is used (within a line). Is it a bug or just very hard to implement in the IDE?
Example:
Class myClass1 has operator_lookup implemented as follows:
Function operator_lookup(name as string) As myClass2
return new myClass2
End Function
Class myClass2 has a method called Alert:
Sub Alert(msg as String)
MsgBox msg
End Sub
Now in a button, we could write:
[code] dim c as new myClass1
c.anyname.Alert(“test”) //.Alert does not auto-complete![/code]
Obviously, anyname wouldn’t be auto-completed, that’s entirely clear to me. However, the code following thereafter could be auto-completed as there’s no ambiguity (only one function and returning an instance of myClass2).
Michel, yep that’s what I often experienced last year. Fortunately, 2015r4 seems to fix many of those instances.
The case outlined in my original posting, however, can reliably be reproduced even across different operating systems. Hence my guess that this simply isn’t implemented.
Autocomplete nerver looks at operator_lookup as it would then also have to read & parse, and maybe actually RUN, the code that is implemented in operator lookup
Basically, once Operator_Lookup is implemented, nearly anything becomes valid at compile time. So autocomplete can’t suggest anything because it could suggest ANYTHING.
But you can have multiple lookup operators. At least in theory according to the docs. I’ve never tried it though. Operator_Lookup is generally a bad idea.