Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter breaks up xor assignment operator #657

Closed
WesleyClements opened this issue May 7, 2024 · 3 comments
Closed

Formatter breaks up xor assignment operator #657

WesleyClements opened this issue May 7, 2024 · 3 comments
Labels

Comments

@WesleyClements
Copy link

Godot version

4.2.2

VS Code version

1.89.0

Godot Tools VS Code extension version

2.0.0

System information

Windows 11

Issue description

The formatter will add a space in between the ^ and = in the xor assignment operator.
This:

var num = 4
num ^= 20

turns into this:

var num = 4
num^ = 20

This is invalid gdscript and so breaks compilation.

Steps to reproduce

Use the xor assignment operator anywhere and then format the document.

@tarwich
Copy link

tarwich commented Jun 21, 2024

More examples that bit me this week:

var poweroftwo = 2 ** 4
# Results in the following, which breaks the compiler
# var poweroftwo = 2 * * 4

var inversion = 2 * -1
# Results in the following which is a preference issue alone
# var inversion = 2 * - 1

@tarwich
Copy link

tarwich commented Jun 21, 2024

Duplicate of #653 #601 #602 #609

Resolved in #605

DaelonSuzuka added a commit to DaelonSuzuka/godot-vscode-plugin that referenced this issue Nov 3, 2024
@DaelonSuzuka
Copy link
Collaborator

I believe the fix for this was already published, but I just added some extra tests to cover this.

DaelonSuzuka added a commit that referenced this issue Nov 18, 2024
* add new style of formatter snapshot tests
* add many new test cases
* fix several open issues( #728, #624, #657, #717, #734, likely more)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants