Open rcanpahali opened 4 months ago
pick_random
returns a variant which for the analyzer is compatible with PackedScene
(though unsave). So we end up with the type of the assigned expression but a variant doesn't has much value for autocompletion.Edit: Just to clarify this any icon is used for all local variables at the moment. The type of the variable has no influence on it. I consider the scope of this issue to be the not working autocompletion. It might make sense to create a separate issue to request a better icon for local variables though.
Not sure if related, but I realise that type hints are not working (also giving me "any", which I see is not an issue here).
But for example.
var mesh: MeshInstance3D = get_child(0)
mesh.get_surface_override_material(0) # this gives no autocompletion
I find that I am needing to use the as
keyword a lot to get autocompletion to work.
Not sure if related, but I realise that type hints are not working (also giving me "any", which I see is not an issue here).
As long as you are still on 4.2 no need to worry, https://github.com/godotengine/godot/pull/85224 should've fixed that. If you are using 4.3 please open an issue with an MRP about it.
Tested versions
System information
Apple M1 Pro - macOS 14.5 (23F79)
Issue description
I already defined my
npc
variable as aPackedScene
in the line 6, but for some reason, the editor IntelliSense in the suggestions shows its type asany
, and I couldn't see the actual methods related to thePackedScene
.npc.instantiate()
method is working fine but the method is not shown in the auto-complete list,Steps to reproduce
To reproduce the steps, simply create a script as follows:
Minimal reproduction project (MRP)
Archive.zip