Should Extends Methods AutoComplete With Module name

It seems to me that logically extends methods should only autocomplete on their target data type and not with the module they are in… but I may be wrong.

I have a module called CD

and in it I have a a global method:
Function Int(Extends EnumVal as CD.AnEnum) As Integer
Return Integer(EnumVal)
End Function

But CD.Int autocompletes, which I don’t want … (I have useing using name spaces (modules and modules in modules) along with Enums to make autocomplete more useful when there are a lot of options - to have smaller but logically hierarchical lists of options for autocomplete.

Having CD.Int autocomplete dirties up the autocomplete list with a nonsense option!!!

So is this a bug?

And yes in this case I am trying to make using Enums in place of integers (instead of a long flat list of of constants for bunch of unrelated things) easier.

What I want to be able to do (and I can- but with the above issue) is:

Dim X as integer = CD.anEnum.AnEntry.Int
DIm EnumVar As anEnum
Dim X as integer = EnumVar.Int

I find this much more readable, easier to type and a better flow (thought wise) than having to cast to integer, particularly when passing parameters or in a select case statement.

I would love to see an Value function for all Enums written into the framework so we could always do the above without having to write extends method for every enum we create. but I suspect Xojo Inc would not like “int” and prefer something like “Value” as Enums can be any integer type):

Dim X as integer =EnumVar.Value
Dim X as integer = CD.anEnum.AnEntry.Value

  • Karen
1 Like

Should it ? Probably not
Does it ? yes with enums autocomplete makes a number of mistakes like this that I know about.
They’re just not that easy to fix despite having tried several different times.