Fix incorrect tooltip when local methods override global functions#117308
Open
EdwardChanCH wants to merge 1 commit intogodotengine:masterfrom
Open
Fix incorrect tooltip when local methods override global functions#117308EdwardChanCH wants to merge 1 commit intogodotengine:masterfrom
EdwardChanCH wants to merge 1 commit intogodotengine:masterfrom
Conversation
7ad1cc6 to
0caaf0c
Compare
Contributor
Author
|
Below is a full summary of what this PR fixed, and what will be fixed in future issues/proposals: class_name _Main
extends Node
# Shows NATIVE_METHOD_OVERRIDE warning.
func get(_property: StringName) -> Variant:
# Shows tooltip Object.get() on hover center.
# Shows tooltip Object.get() on hover first letter.
return 100
# Missing warning. --> Proposal #14425
func char(code :int):
# Shows tooltip @GDScript.char() on hover center.
# Shows tooltip @GDScript.char() on hover first letter.
return 200
# Missing warning. --> Proposal #14425
func log(x: float):
# No tooltip on hover center. <-- Fixed! Now shows @GlobalScope.log().
# No tooltip on hover first letter. <-- Fixed! Now shows @GlobalScope.log().
return 300
func unique(n: float):
# No tooltip on hover center.
# No tooltip on hover first letter.
return 400
# Note: Named lambdas do not actually override anything.
var named_lambda_1 = func get():
# No tooltip on hover center.
# Shows tooltip _Main.get() on hover first letter. --> Issue #117305
return null
var named_lambda_2 = func char():
# Shows tooltip @GDScript.char() on hover center. <-- Fixed! Now no tooltip.
# Shows tooltip @GDScript.char() on hover first letter. --> Issue #117305
return null
var named_lambda_3 = func log():
# No tooltip on hover center.
# Shows tooltip _Main.log() on hover first letter. <-- Fixed! Now shows @GDScript.char(). --> Issue #117305
return null
var named_lambda_4 = func unique():
# No tooltip on hover center.
# Shows tooltip _Main.unique() on hover first letter. --> Issue #117305
return null
func _ready() -> void:
# Shows tooltip _Main.log() on hover center. <-- Fixed! Now shows @GlobalScope.log().
# Shows tooltip _Main.log() on hover first letter. <-- Fixed! Now shows @GlobalScope.log().
print(log(10)) # Prints 2.30258509299405
var main = _Main.new()
# Shows tooltip _Main.log() on hover center.
# Shows tooltip _Main.log() on hover first letter.
print(main.log(10)) # Prints 300 |
This was referenced Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #106840
Related: #106984
Note: This is split from #106987, since the original PR became too bloated.