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

External Editor: Can't access parent class variables in child class but can access them after restarting Godot #39713

Closed
Arun-N opened this issue Jun 20, 2020 · 4 comments · Fixed by #47891

Comments

@Arun-N
Copy link

Arun-N commented Jun 20, 2020

Godot version:
3.2.1

OS/device including version:
Windows 10

Issue description:
I'm using VSCode as an external editor and any time I declare a new variable in a parent class, I can't access that variable in a child class (error: not declared in current scope) unless I restart Godot entirely. Not sure if it's related, but it also shows "possible cyclic resource inclusion" message along with the reference error in Godot's output tab. This doesn't seem to be happening with the in-built editor.

As a side note, I followed the steps show in the docs to set up VSCode for use with Godot

Steps to reproduce:

  1. Set up an external editor.
  2. Open parent and child class scripts in the external editor by double-clicking the respective gdscript files.
  3. Create variable in parent class
  4. Try to use this variable in child class - It shows the "not declared in scope" error
  5. Exit Godot entirely
  6. Open the scripts again. Now that variable can be called inside the child class without any error popping up

Minimal reproduction project:
I don't think it's project dependent but here's the one I was facing this issue in.
Godot Platformer.zip

@KoBeWi
Copy link
Member

KoBeWi commented Jul 6, 2020

Isn't this issue with VS Code plugin?

@Arun-N
Copy link
Author

Arun-N commented Jul 6, 2020

Isn't this issue with VS Code plugin?

Thought about that but then reloading vscode doesn't solve it. I have to restart Godot for it to go away. Not sure if the issue is on the plugin side or Godot side

@linkpy
Copy link
Contributor

linkpy commented Oct 27, 2020

After looking at the messages exchanged between the LSP server and the VSCode extension, it seems like the autocomplete suggestions in that case is all of the available identifiers (classes, GDScript functions, class functions, ...) and there is so much of it that vscode debugger isn't able to show it.

For me the issue is on the LSP server, not on the extension. The extension doesn't handle that kind of logic, neither the VSCode language adaptator interface, that kind of operations are done on the LSP server.

Razoric480 added a commit to Razoric480/godot that referenced this issue Apr 14, 2021
This updates global classes and exposes base member variables.
Fixes godotengine#39713
@akien-mga akien-mga added this to the 4.0 milestone Apr 24, 2021
akien-mga pushed a commit to akien-mga/godot that referenced this issue Apr 26, 2021
This updates global classes and exposes base member variables.
Fixes godotengine#39713

(cherry picked from commit b16bb33)
akien-mga pushed a commit that referenced this issue Apr 26, 2021
This updates global classes and exposes base member variables.
Fixes #39713

(cherry picked from commit b16bb33)
@hdorer
Copy link

hdorer commented Jul 28, 2024

This is still happening to me in Godot 4.2.2

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