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

GDScript doesn't recognize some newly added members until editor restart #76383

Closed
KoBeWi opened this issue Apr 23, 2023 · 8 comments · Fixed by #92616
Closed

GDScript doesn't recognize some newly added members until editor restart #76383

KoBeWi opened this issue Apr 23, 2023 · 8 comments · Fixed by #92616

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Apr 23, 2023

Godot version

4.0.2

System information

Windows 10 x64

Issue description

I have a ScriptB with InternalClass and a ScriptA which has a method that returns InternalClass. If I add an InternalClass2 and change the method to return it, I get an error that the class does not exist. It requires editor restart to fix the error.

The error is also slightly different, depending on whether I use the class as return type or as return value:

godot.windows.editor.dev.x86_64_r1TRrgYr2O.mp4

Steps to reproduce

  1. Open the MRP.
  2. Open ScriptB
  3. Uncomment InternalClass2.
  4. Go to ScriptA.
  5. Change InternalClass to InternalClass2.
  6. Error
  7. Restart editor
  8. No error

Minimal reproduction project

gdbug.zip

@NickMakesGames
Copy link

Surprised to see that this bug has remained open for almost a full year now - curious as to the current priority status?
As it stands, this frequently leads to a lot of misleading errors while I'm editing my game's code, and the only workaround is to manually reload the whole project after implementing a feature to get accurate messaging.
Would really love to see a resolution to this as it makes editing multiple GDscript files extremely cumbersome

@Luke9389
Copy link

This issue has been plaguing a project now for multiple weeks. Is there any way to add attention/urgency to this?

Also I noticed the version info above says 4.0.2, but the closed issue marked as a dupe has this on 4.2.1 (which is also where I'm experiencing it).

@Rustywolf
Copy link

@Luke9389 I've had this issue in multiple versions since 4.0 dropped so I dont think its anything to do with a specific version.

@KoBeWi
Copy link
Member Author

KoBeWi commented Apr 23, 2024

Issues are always assumed to be relevant in the newest available version, unless they have 3.x milestone.
I'm still encountering this one in 4.3.

@Luke9389
Copy link

Have any of you been able to work around this by using VS Code instead of scripting in the engine?

@Rustywolf
Copy link

@Luke9389 VSCode uses the language server so would have (and in my experience, does have) the same issues

@Luke9389
Copy link

One thing I find strange is that I can open a brand new project, attempt to replicate this behavior, and it's totally fine. This caused me to wonder if perhaps it was a gdLint problem, or something within godot-gdscript-toolkit.

@Kylemcarthur
Copy link

Seems likely the same as or at least similar to #70841

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

Successfully merging a pull request may close this issue.

6 participants