godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.47k stars 148 forks source link

GDScript formatter removing spaces around "||" #601

Closed ultsi closed 1 week ago

ultsi commented 4 months ago

Godot version

4.3.dev3

VS Code version

1.86.1

Godot Tools VS Code extension version

2.0.0

System information

linux

Issue description

The code formatter removes spaces around the || operator in if clauses. It doesn't remove spaces around or.

Steps to reproduce

func test_if_or() -> void:
    var a := false
    var b := true
    if a || b:
        pass
    if a or b:
        pass

After autoformatting:

func test_if_or() -> void:
    var a := false
    var b := true
    if a||b:
        pass
    if a or b:
        pass
DaelonSuzuka commented 4 months ago

Thanks for the report. I never use ||/&& because or/and are available, so I forgot them when I we were building the formatter tests.