godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.13k stars 21.17k forks source link

Improving "Go to definition" in GDScript #7080

Closed Zylann closed 4 years ago

Zylann commented 7 years ago

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

vnen commented 7 years ago

Have you tried Ctrl+Click? Doesn't work very well, but it's a problem with GDScript inference in general.

Zylann commented 7 years ago

Hmm it doesn't works in 2.1, even on obvious cases, is it a recent feature?

vnen commented 7 years ago

Yes, it's relatively recent.

vnen commented 7 years ago

It was introduced in September: 37f1e86

Zylann commented 7 years ago

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

ghost commented 6 years ago

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.

Zylann commented 6 years ago

Ctrl+click in Godot 3.0.2:

akien-mga commented 5 years ago

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.

akien-mga commented 5 years ago

Some of those issues are apparently fixed by #31843, it would be good to review this issue and see what is still relevant.

KoBeWi commented 4 years ago

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.

KoBeWi commented 4 years ago

So as I said in previous comment, this issue is very old and confusing, so closing it in favor of #33898