godotengine / godotengine/godot-vscode-plugin
Incorrect formatting for negative indices/keys
Open
bug
formatter
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 257
- PR merge metrics
- No merged PRs in 30d
Description
### Godot version
4.4.1
### VS Code version
1.102.2
### Godot Tools VS Code extension version
2.5.1 as well as Dev Build (as of 2025-07-24)
### System information
Windows 11
### Issue description
Negative indices are not formatted correctly in certain situations. For example, `x[-1]` gets formatted to `x[ - 1]`.
### Steps to reproduce
The following code
```
some_array[-1] = 0
print(some_array[-1])
```
formats to
```
some_array[-1] = 0
print(some_array[ - 1])
```
Contributor guide
Assessment
This issue has not been assessed yet.