Skip to content

Formatter issue related to extra space in front of class_name #235

@TonyinFL

Description

@TonyinFL

I am using the formatter (gdscript-formatter 0.20.1) within Godot 4.6.3 in WIndows 11 and wanted to report a simple bug that seems to occur when there is more than one space in-between class_name and the class. For example, the following simple script failed when triggering the formatter via CTRL-ALT-I in Godot:

class_name        Test
extends Node


func _ready() -> void:
	pass # Replace with function body.


func _process(delta: float) -> void:
	pass

The following messages were shown in the Output window:

ERROR: core/variant/variant_utility.cpp:1024 - Format GDScript failed: res://classes/new_script.gd
ERROR: core/variant/variant_utility.cpp:1024 - Exit code: 1 Output:
ERROR: core/variant/variant_utility.cpp:1024 - If your script does not have any syntax errors, this might be a formatter bug.

Once I remove the extra spaces between "class_name" and "Test", the formatter was successful with the script.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions