godotengine / godotengine/godot-vscode-plugin

Wrong code formatting with `@abstract` and `is`

Open
#984 1 comment 0 reactions 1 assignee Claimed by @DaelonSuzuka View on GitHub
bug formatter
Dominant language
TypeScript
Stars
2.1k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

### Godot version

v4.7.dev1.official [bf95b6258]

### VS Code version

1.109.5

### Godot Tools VS Code extension version

2.6.1

### System information

Windows 11

### Issue description

When formatting code with `@abstract` in a function before and using `is` with `()` braces around, it will remove the spaces.

### Steps to reproduce

When formatting the following code
```
@abstract
extends RefCounted

@abstract func foo()

func cmp(other: Node):
if (other is Node):
pass
```

The first formatting will be:

```
@abstract
extends RefCounted

@abstract func foo()

func cmp(other: Node):
if (other isNode):
pass
```
and after another
```
@abstract
extends RefCounted

@abstract func foo()

func cmp(other: Node):
if (otherisNode):
pass
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.