Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete doesn't suggest properly when passing through a singleton global variable #75212

Closed
thunderingmarmot opened this issue Mar 22, 2023 · 1 comment

Comments

@thunderingmarmot
Copy link

Godot version

v4.0.stable.official [92bee43]

System information

Windows 11

Issue description

I have an autoload singleton with some children and its script has some onready vars that reference them so that I can do "singleton.child". The problem is that when I write methods in a child script, even if the onready vars in the singleton are statically typed, if I access them from outside the singleton using its global variable, autocomplete won't suggest them, but will only suggest the child's base class methods. Though, if inside the singleton I access those same onready variables without passing through the singleton global variable, autocomplete works as expected.

Steps to reproduce

  1. Create a scene with Node as a parent
  2. Add a Node as a child of the previous Node
  3. Attach a script to the parent Node and declare an onready var that references its child like so @onready var child := $childNode as ChildNodeType
  4. Attach a script to the child Node and declare a random function like so func random_function(): pass
  5. Set the whole scene as an autoload singleton with the global variable turned on
  6. Create another scene to set as main scene
  7. Attach a script to the parent node of that scene and in its _ready function try to access the random_function we declared before passing through the singleton global variable
  8. You will now notice how singleton.child.random_function() doesn't get autocompleted, but works anyway

Minimal reproduction project

SingletonAutocompleteTest.zip

@Calinou
Copy link
Member

Calinou commented Apr 1, 2023

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2023
@Calinou Calinou added archived and removed usability labels Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants