Inline lambda parsed incorrectly
var x = func(y): return y == 1 if true else func(y): return y == 2
In my case it throws an exception. Could it give a warning instead? This had the great advantage to not block the other parts (and scripts) from being formatted.
Example (where the last line is the culprit):
extends Node2D
var bubble_scene = preload("res://environment/bubble.tscn")
func _ready() -> void:
spawn_bubble()
func spawn_bubble() -> void:
var bubble = bubble_scene.instantiate() as Bubble
add_child(bubble)
bubble.tree_exited.connect(func(): if bubble.is_queued_for_deletion(): spawn_bubble())
EDIT: I didn't see the workaround in https://github.com/Scony/godot-gdscript-toolkit/issues/191#issuecomment-2064904617. EDIT2: But I can't figure out how to do it in this case.
In my case it throws an exception. Could it give a warning instead? This had the great advantage to not block the other parts (and scripts) from being formatted.
Example (where the last line is the culprit):
extends Node2D var bubble_scene = preload("res://environment/bubble.tscn") func _ready() -> void: spawn_bubble() func spawn_bubble() -> void: var bubble = bubble_scene.instantiate() as Bubble add_child(bubble) bubble.tree_exited.connect(func(): if bubble.is_queued_for_deletion(): spawn_bubble())EDIT: I didn't see the workaround in #191 (comment). EDIT2: But I can't figure out how to do it in this case.
Last time I've checked, Godot had no support for inline if in lambda so the above code would be invalid. I'll revisit that and potentially add support for that.