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

Custom class in Autoload script do not have autocompletion #75021

Closed
nilan256 opened this issue Mar 17, 2023 · 5 comments
Closed

Custom class in Autoload script do not have autocompletion #75021

nilan256 opened this issue Mar 17, 2023 · 5 comments
Labels

Comments

@nilan256
Copy link

Godot version

v4.0.1.rc1.official [d23922f]

System information

MacOS 13.2, Mac mini(Inter chip)

Issue description

Please review the issues in the video.

autoload-no-autocompletion.mov

Here is my autoload setting.

autoload-setting

As shown in video, custom class in autoload script has no autocompletion hints.
But declare the autoload type as a variable seems correctly, like the "g" variable in video.

Just a guess, it seems be able to infer the type, just broken in autocompletion.
If type the following code:

Globals.dog.age = "a string"

Even "age" is no static references, you can't "Command + click" to jump to declaration.
But the editor will alert an error "String to Int".

I have tried the Internal class Sprite2D is ok, all works fine.

Steps to reproduce

  1. Create a gdscript , and set to "Autoload".
  2. Add a variable of custom type (Node or Object)
  3. Open another gdscript file
  4. Type some code to access members of your custom type.

Minimal reproduction project

autoload-no-autocompletion.zip

@AThousandShips
Copy link
Member

AThousandShips commented Mar 17, 2023

Is this the same as #74888?

@nilan256
Copy link
Author

Is this the same as #74888?

oh, yes, I missed this similar issue.
The only difference is I'm use a variable of autoload, but not a returned of function.
I tried:

var dog = Globals.dog as Animal
dog.jump() # autocompletion correctly

Should I close the issue? I'm first report an issue on github.

@AThousandShips
Copy link
Member

If it covers your issue then yes, otherwise keep it open, or if you're unsure

@nilan256
Copy link
Author

If it covers your issue then yes, otherwise keep it open, or if you're unsure

I think that after the problem is fixed should also solve my problem.
Thank you.

@AThousandShips
Copy link
Member

No problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants