-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
"Lookup Symbol" or "Ctrl+LMB" not working for functions defined in script of another node #82258
Comments
As far as I know, if you don't declare class_name, you can't get any intellisense for your custom function. |
Getting the same results. This code seems to be working as expected and Lookup symbol is working.
Although, this means we need to write extra code and define a class_name for each script. It works just fine in 3.5. |
It seems like 4.1 has trouble deducing the type of $ expressions, while in 3.x it did that just fine. |
Isn't this because $ChildNode is defined @onready, and unless we run this as tool-script, onready is simply never called? |
Turning the script into a tool script doesn't change the issue. In fact, I originally noticed the issue while working on tool scripts. |
I would guess that it's because |
Generally speaking, autocompletion with dynamic typing is not always possible. But in this case, we could infer a weak type using the editor's information about the current scene, just as we autocomplete node paths. (The same script can be attached to multiple scenes, so autocompletion is not possible without an open scene.) |
Godot 3 managed to pull this off quite reliably. Is there a way to bring back that feature? |
I'm also having this issue! We'll see how it goes. |
It is definitely possible in this context to interfere the script. I added code for this in #79386 however the sorting seems to be broken currently. I used the MRP with a custom build from the PR:
|
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
Godot version
v4.2.beta1.official [b137180]
System information
Windows 10 - Godot v4.1.1.stable.official
Issue description
Including a reference to a child node, and accessing a function on the child node works in game.
However, trying to use the "Lookup symbol" option or CTRL+LMB on the function from the script editor does not work at all.
This works fine in Godot 3.5.
Additionally, the functions defined in the child node are not suggested in auto-complete in the parent node's script.
Steps to reproduce
ParentNode
ChildNode
@onready var child = $ChildNode
) Note: the issue only happens when onready is used.Minimal reproduction project
lookupBug.zip
The text was updated successfully, but these errors were encountered: