Closed Zylann closed 4 years ago
Have you tried Ctrl+Click? Doesn't work very well, but it's a problem with GDScript inference in general.
Hmm it doesn't works in 2.1, even on obvious cases, is it a recent feature?
Yes, it's relatively recent.
It was introduced in September: 37f1e86
Oh, that's great :) Indeed it is limited to what the parser can infer (which could be improved). It doesn't open filenames though :3
First of all thank you for your report and sorry for the delay.
We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.
We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us. Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about it here?
For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.
Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.
Thanks in advance.
Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.
Ctrl+click in Godot 3.0.2:
On a file name: open the file:
it works, except when the path is relative. For example, on a preload("thing.gd")
, the editor will fail opening it. A fix would be to take the path of the current script into account.
On a class name: jump to the position in that file where the class is:
Doesn't work on nested classes (declared with class
keyword).
If the class has been "imported" with const Thing = preload("thing.gd")
, the cursor will jump to the import, but maybe it would be better to jump to thing.gd
directly if the import can be resolved statically (like it's the case with const
preloads).
On a function, var or const: jump to the thing, or open the file and go where the thing is defined
Works on member vars,
Works on member functions,
Doesn't work on static functions,
Doesn't work on static functions that are imported using const
preload (which can be resolved statically), for example Util.next_power_of_two(x)
where Util
is const Util = preload("util.gd")
On an API element: open the docs Works on classes, Doesn't work well on class constants (but should be partly fixed by https://github.com/godotengine/godot/pull/17865)
If all else fails... open global find :) Would need this https://github.com/godotengine/godot/pull/16571
I think the situation is already a bit better in the current master branch, but some of the above mentioned issues might still be relevant.
Some of those issues are apparently fixed by #31843, it would be good to review this issue and see what is still relevant.
Some update:
On a file name: open the file: it works, except when the path is relative
The problem is that relative paths aren't even recognized as paths. IMO it's fine that it supports only "res://", I don't remember using non-res:// paths ever (or at least since I discovered filename drag and drop).
If the class has been "imported" with const Thing = preload("thing.gd"), the cursor will jump to the import,
Only in this case:
var b = THE_SCIRPT.new()
Here it won't jump:
var a: THE_SCIRPT
Doesn't work well on class constants
This is fixed now.
I think it would be better to make a tracker listing each case, because it's a bit chaotic here.
So as I said in previous comment, this issue is very old and confusing, so closing it in favor of #33898
I would bet this would has been asked already, but I cannot find an issue about this.
It would be a great time saver if we could go to the definition of something in GDScript with a right-click menu + a shortcut.
All this, of course, using the existing information the editor has / can get when parsing the file. I've surprised myself too many times trying to right-click on something to "go to definition", noticing it's not there, and trying to remember where the thing is and open files manually and scroll :p
I apologize if this has been asked already but I can't find an existing issue :s
Edit: I renamed the issue since this already exists and supports some of the features