Godot: [TRACKER] Issues with Go to definition (Ctrl + Click)

Created on 25 Nov 2019  路  3Comments  路  Source: godotengine/godot

Godot version:
3.2 beta2

Issue description:
Soo there's this old issue #7080 which is a bit chaotic, so I decided to make a fine tracker for all the cases. If someone knows an example of go to definition failing, pls comment. Also not all examples have issues created, so scroll below for code.

So far it is known that go to definition (Ctrl + Click) fails on:

  • [x] Relative paths (#33859)
  • [x] Preloaded script used as type
  • [x] Property accessors
  • [x] Typed onready variables (related to #33434)
  • [x] Members of custom class' properties (might be something broader)
  • [x] Methods from custom classes used as argument types (might be related to above)
  • [x] Autoload singletons with built-in scripts

Non-issued examples:

  • Preloaded script used as type
const THE_SCRIPT = preload("res://TheScript.gd")

var variable: THE_SCRIPT #fails
var b = THE_SCRIPT.new() #works
  • Property accessors
var test: Control
test.set_visible(false) #should jump to visible property doc, goes to Control
  • Typed onready variables
onready var test_node: Control = $Some/Control
func _ready() -> void:
    test_node.hide() #hide isn't found
  • Members of custom class' properties
class_name TestClass
var velocity: Vector2

#another script
func test(test_obj: TestClass):
    test_obj.velocity.reflect(Vector2()) #can't go to reflect
  • Methods from custom classes used as argument types
class_name Test
func test_method():
    pass
#another script
func meth(arg: Test, vec: Vector2):
    var brg := Test.new()
    arg.test_method() #this doesn't work (can't go to definition)
    brg.test_method() #this does
        vec.normalized() #this too
  • Autoload singletons with built-in scripts
func some_func():
    MySingleton.do_stuff() #clicking MySingleton won't work, but do_stuff() will jump correctly
enhancement editor gdscript tracker usability

Most helpful comment

Also, this does not work with scene singletones (the scene script is internal). At the same time, if you click on the singleton property, it will work.

All 3 comments

[ ?] Property Descriptions
e.g. methods set (get) _process_priority should point to the process_priority property

https://docs.godotengine.org/en/3.1/classes/class_node.html#class-node-method-set-process-priority
https://docs.godotengine.org/en/latest/classes/class_node.html#class-node-method-set-process-priority
https://docs.godotengine.org/en/latest/classes/class_node.html#class-node-property-process-priority

Also, this does not work with scene singletones (the scene script is internal). At the same time, if you click on the singleton property, it will work.

"Typed onready var" example works if the script belongs to the currently open scene.

Was this page helpful?
0 / 5 - 0 ratings