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

Add support for Godot 4.2 static typing for for loop variable #236

Closed
chrisl8 opened this issue Oct 16, 2023 · 2 comments
Closed

Add support for Godot 4.2 static typing for for loop variable #236

chrisl8 opened this issue Oct 16, 2023 · 2 comments
Labels
bug Something isn't working formatter parser

Comments

@chrisl8
Copy link
Contributor

chrisl8 commented Oct 16, 2023

Godot 4.2 now supports typing the variable declaration in a for loop:
godotengine/godot#80247

However gdformat fails when this syntax is used.

As of Godot 4.2 Beta, this syntax is valid:

var dict := {1: 2}
for key: String in dict:
    print(key)

However, running gdformat on it results in this error:
Previous tokens: [Token('NAME', 'key')]

@Scony Scony added enhancement New feature or request formatter parser bug Something isn't working and removed enhancement New feature or request labels Oct 16, 2023
neilgoodman added a commit to neilgoodman/godot-gdscript-toolkit that referenced this issue Oct 24, 2023
@neilgoodman
Copy link
Contributor

I ran into this issue the other day when using Godot 4.2 beta 2. I just submitted a PR to address it. My changes are working for me locally.

neilgoodman added a commit to neilgoodman/godot-gdscript-toolkit that referenced this issue Oct 25, 2023
@Scony Scony closed this as completed in 62e429a Oct 25, 2023
@chrisl8
Copy link
Contributor Author

chrisl8 commented Oct 26, 2023

Works great @neilgoodman ! Thanks so much for the quick fix! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatter parser
Projects
None yet
Development

No branches or pull requests

3 participants