-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Editor: Fix Ctrl+Click
on enum values does nothing
#101127
Editor: Fix Ctrl+Click
on enum values does nothing
#101127
Conversation
dalexeev
commented
Jan 4, 2025
- Fixes Ctrl-Click on enum value/member does nothing #101089.
71add55
to
4cef91e
Compare
This doesn't work across preloaded scripts. It jumps to the right line but not to the right file. # a.gd
enum Test {
E1,
E2,
} # b.gd
const A := preload("a.gd")
func _init():
A.Test.E1 # Looking up E1 here doesn't jump to a.gd |
Tested this, it seems to also be reproducible in 4.3.stable. If you can confirm, I think we could still merge this PR as a regression fix, and open a new issue for the problem of preloaded scripts? |
In 4.3 enums values seem to jump to the documentation, which apparently only works if the script (a.gd) has a class_name, if this isn't the case it just doesn't jump. That's probably worth to open an issue about, but it is different problem than jumping to the right line in the wrong file. |
After #91060, the lookup result produced for enum values in this case is just wrong, this PR tries to fix it by setting the right line and while this might fix the jump (if paired with also setting the right script) it doesn't fix the wrong lookup result, which still points to a class constant of a.gd with the same name as the enum value. For some reason, as long as no such class member exists the editor still targets the enum value for documentation tooltips (we should investigate that, it seems wrong to me), but if such a class member exists the doc tooltip will prefer it over the enum value. Let's say I add a new constant to a.gd like this:
That's the underlying issue we should fix IMO. #101089 is just a symptom of it, from how I understand the code. |
Thanks! |
This was approved and merged a bit fast without taking into account the bug @HolonProduction identified above, and the competing PR they opened: #102401. |