after a “using” clause shouldn’t it’s constants autocomplete?

In order to reduce my global namespace to speed up typing in the IDE (which it failed to do unfortunately) I made a bunch of modules with large numbers of constants in them protected instead of global. In order to avoid having to type the module name a thousand times in other methods that use them I understand that I can use the “using” clause to add that namespace to any given method. That works, the constants do compile but they do not autocomplete after doing that. Nor do they autocomplete if you use the add to project->using clause menus.

Shouldn’t they autocomplete after adding the using clause?

Feature request?

From my experience Using and autocomplete are more or less not working.

Quick test shows that after Using Xojo.Core dimming a dictionary shows the properties of Xojo.Core.Dictionary instead of classic.

Same thing Dimming explicit as Xojo.Core.Dictionary.

It is possible, however, that not all the framework autocomplete is implemented. Heck, System.MouseX does even autocomplete, and it is not new framework.

But only in code. When you add a Using clause to a module or class in the navigator, it doesn’t work in most cases.

So it’s hit or miss at the moment. When adding the clause to a module via the add to module menu system it definitely does not autocorrect my own modules. Adding that let me not have to edit all my existing modules, but it doesn’t make it easy to write new methods that use it. I LOVE autocomplete :wink: You can’t just pull it out from under me that way :wink:

So that’s why its been so finicky for me. I’ve been trying to add feedback cases for a lot of these and I find them hard to reproduce when I try to simulate them in a test project. Any idea if there’s a feedback case for this?

I don’t use Using clauses at all.

I just checked. Autocomplete works just fine in modules with full namespaces.

Unless someone works in the perspective of code shared directly between iOS and desktop, for instance, Using is kind of dangerous. Not to mention limiting.

If XOJO wasn’t so verbose in syntax this would be less of a problem.

if obj isA myModule.childModule.myClass then
  dim myObject as myModule.childModule.myClass = myModule.childModule.myClass(obj)
  dim myObjects() as myModule.childModule.myClass
  myObjects.append(myObject)
  for each entity as myModule.childModule.myClass in myObjects
    //do something
  next
end

With using:

using myModule.childModule
if obj isA myClass then
  dim myObject as myClass = myClass(obj)
  dim myObjects() as myClass
  myObjects.append(myObject)
  for each entity as myClass in myObjects
    //do something
  next
end

With improvements Xojo SHOULD have (implied type definition)

using myModule.childModule
if obj isA myClass then
  dim myObject = myClass(obj)
  dim myObjects() as myClass
  myObjects.append(myObject)
  for each entity in myObjects
    //do something
  next
end

lol and I see that the forum thinks I typed a bad word and replaced it with comic book swear word characters :slight_smile:
What I typed was it’s hit or miss. I suppose it’s possible I left out the space as I was typing fast and didn’t proof read :wink: But that was not my intention! If it replaces this one too then the logic it uses to find such things is a little vague :wink:

LOL it DID replace it again. So on this forum you cannot type the contraction of it and is followed by the word hit :slight_smile: that highly amuses me.

should - sure
does - not always
Right now the IDE has one set of code to walk through class hierarchies etc and determine what is / is not in scope so it can figure out how to autocomplete things.
It doesn’t always match how the compiler does things.
So the IDE may not show autocomplete for things that it should or can show the wrong autocomplete items
This is a known thing.
It’s existed since the IDE started being written in Realbasic in 2005 in various forms.

Ideally the compiler & IDE could use the same logic and code but thats not how it is today.