Feedback Case Number: 64783.
This bug has been present forever but it’s increasingly driving me nuts.
Autocomplete essentially fails completely to suggest fields on a class in a module if the instance was not declared using its fully qualified class name.
What do I mean? Well, do this:
- Create a module (
Module1
). - Create a class within this module (
Class1
). - Add a method to
Class1
calledEcho(s As String) As String
. - In
App.Open
put this code:
Var c1 As New Class1
Var s As String = c1.Echo("Something")
As you type c1.
you will not be given any autocomplete options. You should be given the option to autocomplete Echo
.
However, if you declare an instance of Class1
using its fully qualified class name, autocomplete works as expected:
Var c2 As New Module1.Class1
Var s As String = c2.Echo("Something")
This is an important bug that should be addressed. Since we can’t rely on the IDE’s autocomplete when using classes in modules unless we use their fully qualified class name to leads to two issues:
- Code bloat and extra noise. Why should I have to do this:
Var doc1 As New Mammals.People.Professionals.Doctor
Var doc2 As New Mammals.People.Professionals.Doctor
Var doc3 As New Mammals.People.Professionals.Doctor
Var doc4 As New Mammals.People.Professionals.Doctor
Var b1 As New Mammals.People.Tradesmen
When I could do this?
Using Mammals.People.Professionals
Using Mammals.People.Tradesmen
Var doc1 As New Doctor
Var doc2 As New Doctor
Var doc3 As New Doctor
Var doc4 As New Doctor
Var b1 As New Builder
I’d like to point out that Using
is a real keyword in the Xojo language that is terribly broken for reasons also related to autocompletion.
- People stop putting classes in modules and instead stuff them in the global namespace with ugly prefixes or suffixes. Doing this means autocomplete will always work but then you end up with ugly class names and it’s increasingly difficult to reuse code and share it as classes are not properly namespaced:
Var doc1 As New MPPDoctor
Var doc2 As New MPPDoctor
Var doc3 As New MPPDoctor
Var doc4 As New MPPDoctor
Var b1 As New MPTBuilder
Can anyone send some love to this case?