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

Ctrl + Clicking on a variable no-longer takes you to that variable, when said variable is within a Global Autoload- 4.4 dev7 #100680

Closed
AlexYates opened this issue Dec 21, 2024 · 6 comments · Fixed by #100707

Comments

@AlexYates
Copy link

Tested versions

  • Reproducible in: 4.4.dev7
  • Not reproducible in: 4.3.stable

System information

Godot v4.3.stable - Windows 10.0.19045 - GLES3 (Compatibility) - AMD Radeon RX 6650 XT (Advanced Micro Devices, Inc.; 32.0.12033.1030) - AMD Ryzen 5 5600G with Radeon Graphics (12 Threads)

Issue description

CTRL + Clicking on a variable that's referenced from a global-autoload file, now takes you to the auto-generated help for that file, rather than taking to the referenced variable. As-though the global-autoload is now regarded as a class.

In 4.3.stable, you'd be taken straight to that variable;

Steps to reproduce

Video: https://github.com/user-attachments/assets/15287001-780d-4c26-82f7-bd797eacb6ee


# ./globals/core.gd
extends Node;

var is_paused:bool;
# ./main.gd
extends Node;

func _ready() -> void:
	Core.is_paused = true;

Add the ./globals/core.gd file as a Global Autoload, then CTRL + Click on the is_paused variable in ./main.gd.

Minimal reproduction project (MRP)

MRP: 44dev7.zip

@dalexeev
Copy link
Member

The problem is that Ctrl+LMB is used not only to jump to the source code, but also to open the documentation for native symbols. In the case of custom symbols, there is both documentation and source code, which causes a conflict.

I think we should split the functionality into two combinations. Say, Ctrl+LMB and Alt+LMB. Or Ctrl+LMB and Ctrl+RMB.

@mooflu
Copy link

mooflu commented Dec 21, 2024

I see this in other scenarios, too, not just autoload globals.
It seems to get into a state where CTRL-click takes you to the help like it's a built in.
In larger project of mine it doesn't seem to happen right after starting Godot only after using it for a while.

I can repro the MRP above the first time I open it. When I restart Godot and re-open, CTRL-click works. Need to remove .godot contents and restart for it to happen again.

Possibly related: CTRL-clicking on any of my enum values does nothing.
E.g. enum like this:

class_name E extends Object

enum Team {
	None,
...
func test():
	var t = E.Team.None

and CTRL-clicking on the 'None' of E.Team.None does nothing.
When changing var t to var t2, save and CTRL-click on None it now takes me to the doc page.

Tried 4.4dev6 and all of the above seems to work as expected.
Maybe related to the new hover doc changes in dev7?

@mooflu
Copy link

mooflu commented Dec 21, 2024

When I revert 80d1150 of #91060 it works as expected.

@MarkoGrbec
Copy link

The problem is that Ctrl+LMB is used not only to jump to the source code, but also to open the documentation for native symbols. In the case of custom symbols, there is both documentation and source code, which causes a conflict.

I think we should split the functionality into two combinations. Say, Ctrl+LMB and Alt+LMB. Or Ctrl+LMB and Ctrl+RMB.

same is for functions it takes you to documentation instead of source code

I guess you are right that it should be split

@nubels
Copy link

nubels commented Dec 21, 2024

CTRL + LMB also takes me to the documentation instead of the definition outside of autoloads. I assume this is a bug with the newly added documentation tool tips which are awesome, though.

Image

@TheRealSlander
Copy link

TheRealSlander commented Dec 21, 2024

Went to that frustration as well with the 4.4.dev7 (it changed for all scripts, not only the autoload scripts).

Before hand, I was used to Ctrl+LMB to jump to the variables/functions declarations, now it opens documentation, even if I didn't create one (auto-generated documentation I guess)!

I vote for customization of the shortcuts as well, as I want to be able to jump to declaration using Ctrl+LMB and I only want to jump to documentation using something else, like Ctrl+Alt+LMB for example. In general, I want to be able to define all the shortcuts as I want them to be...

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