SUGGESTION: Autocomplete should detect inherited extenders.

Started by monkey0506, Sun 23/08/2009 06:01:31

Previous topic - Next topic

monkey0506

I've been adding some custom extender methods onto the GUIControl type (for all GUIControl types) and I've noticed something. It seems that autocomplete doesn't detect the inheritance of extender methods. I could use the extender methods just fine, but they refused to show up in autocomplete. I even tried the fake-import-in-a-comment trick to no avail.

What I've had to do is actually overload the extender functions for each of the inherited types like:

Code: ags
void SetProperty(this Button*, int value) {
  GUIControl *gc = this;
  gc.SetProperty(value);
}

int GetProperty(this Button*) {
  GUIControl *gc = this;
  return gc.GetProperty();
}


My tests proved that the overloaded versions of the functions were actually getting called as well (which is actually interesting...::)).

However I'm just saying it would be nice if autocomplete could be made to detect the inheritance of my extender methods? Nothing high priority by any means though.

Edit: I corrected the overloaded functions to reflect I am calling the GUIControl method not the overloaded methods recursively... ::)

Edit 2: Somehow I completely failed to recognize at first that the fact that the overloaded functions were getting called is polymorphism. Which is nice. Please don't fix that Chris. :P

Wonkyth

I'd like this as well, as I have enough trouble with spelling errors as it is.
"But with a ninja on your face, you live longer!"

Pumaman


SMF spam blocked by CleanTalk