Autocomplete Suggestion for Method Overloads

Feedback Case Number: 63928

A powerful feature of Xojo that I use a lot is method overloading. For example, if I have a Vector2D class, I might have two methods for computing the dot product. One that takes x and y arguments and one that takes another vector:

Class Vector2D
  Function Dot(x As Double, y As Double) As Double
    Return Self.X * x + Self.Y * y
  End Function

  Function Dot(v As Vector) As Double
    Return Self.X * v.X + Self.Y * v.Y
  End Function
End Class

Unfortunately, the IDE’s autocomplete does not have a UI for displaying overloaded methods:

This could be remedied by including the parameter list for overloaded methods in the autocomplete suggestion box like other IDE’s do:

image_2

In addition to the lack of information presented in the autocomplete suggestion window, the method description at the bottom of the IDE editor pane only ever gives the method single for the first defined overloaded method:

This is very confusing as it suggests to the end user that they are calling one method when in actuality they are calling a different one.

Workarounds:
None. You have to remember that a class has multiple methods with the same name and remember their parameters.

Proposed solution:

  1. Display all matching overloads in the autocomplete suggestion box. They can be easily differentiated with trailing parentheses containing the types.
  2. Show the correct description at the bottom of the IDE for the overload.
5 Likes

I think the easiest may be to just put the types in brackets after the name if there are multiple ones.

1 Like

IIRC the Real Studio IDE hint area would expand to show all of the possible overloads. But I like the idea of putting the parameter names into the Autocomplete popup.

We have a lot of method overloads and it is VERY annoying to have to go to the definition of the method to see if there are overloads. This has been a major shortcoming of the Xojo IDE since the beginning.

4 Likes

@Greg_O_Lone - I agree. This would require Xojo to display in AutoComplete not only the name of a method/function but also its parameters. This would save looking things up in the docs.

Edit: How about a AutoComplete Window with the docs page beside or a short description of the Datatype/Method/Function?

See also:

<https://xojo.com/issue/57796>

Essentially the same request with a suggestion of moving the overload info to the Inspector.

1 Like

Since Xojo Inc are in a bug-bashing mood and are being more receptive to improvements in the IDE recently - does anyone else want to give a thumbs up on the issue tracker for this issue? Currently it’s just me and Kem. Given how useful method overloading is I fail to believe that no one else cares about this.

3 Likes

Done. This would be a great addition.

2 Likes