Skip to content

Fix inconsistent tooltip for @GlobalScope constants#117545

Open
EdwardChanCH wants to merge 1 commit intogodotengine:masterfrom
EdwardChanCH:tooltip_local_var_hides_global_v2
Open

Fix inconsistent tooltip for @GlobalScope constants#117545
EdwardChanCH wants to merge 1 commit intogodotengine:masterfrom
EdwardChanCH:tooltip_local_var_hides_global_v2

Conversation

@EdwardChanCH
Copy link
Copy Markdown
Contributor

Closes: #106944

Related: #117308

Note: This is split from #106984, since the original PR became too bloated.

@EdwardChanCH
Copy link
Copy Markdown
Contributor Author

EdwardChanCH commented Mar 17, 2026

Below is a full summary of what this PR fixed:
(i.e. only the tooltip for the shadowed PI has changed)

class_name _Main
extends Node

var PI = -10 # Shows tooltip @GDScript.PI. <-- Fixed! Now no tooltip.
var OK = -20 # No tooltip.

enum Error { # No tooltip.
	OK = -30 # No tooltip.
}
var Side = -40 # No tooltip.
var MouseButtonMask = -50 # No tooltip.

var number = -60 # No tooltip.

func _ready() -> void:
	var _a = PI # Shows tooltip @GDScript.PI. <-- Fixed! Now shows _Main.PI.
	var _b = TAU # Shows tooltip @GDScript.TAU.
	var _c = OK # Shows tooltip _Main.OK.
	var _d = FAILED # Shows tooltip @GlobalScope.FAILED.
	var _e = Error # Shows tooltip _Main.Error.
	var _f = Error.OK # Shows tooltips _Main.Error and _Main.OK.
	#var _g = Error.FAILED # Shows tooltip _Main.Error.
	var _h = Side # Shows tooltip _Main.Side.
	#var _i = ClockDirection # Shows tooltip @GlobalScope.ClockDirection.
	var _j = MouseButtonMask # Shows tooltips _Main.MouseButtonMask.
	#var _k = JoyButton # Shows tooltips @GlobalScope.@JoyButton.
	var _z = number # Shows _Main.number.
	
	print(_a) # Prints -10
	print(_b) # Prints 6.28318530717959
	print(_c) # Prints -20
	print(_d) # Prints 1
	print(_e) # Prints { "OK": -30 }
	print(_f) # Prints -30
	print(_h) # Prints -40
	print(_j) # Prints -50
	print(_z) # Prints -60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local variable hides @GDScript constant but editor hints otherwise

2 participants