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

Auto Formatter Incorrectly Adding Spaces Around Dot Notation #728

Open
sivercone opened this issue Sep 28, 2024 · 1 comment
Open

Auto Formatter Incorrectly Adding Spaces Around Dot Notation #728

sivercone opened this issue Sep 28, 2024 · 1 comment
Labels

Comments

@sivercone
Copy link

Godot version

4.3.stable

VS Code version

1.91.1

Godot Tools VS Code extension version

2.2.0

System information

macOS 14.6.1

Issue description

Description

When using the auto formatter feature, it incorrectly inserts spaces around the dot notation, which leads to syntax errors in the code. This issue occurs consistently in scripts when saving them, affecting the proper functionality of the code.

Steps to reproduce

Steps to Reproduce

  1. Write the following function in a Godot script:

    func handleDeath() -> void:
        var signalConnections: Array[Dictionary] = self.get_incoming_connections()
        for connection in signalConnections:
            connection.signal.disconnect(connection.callable)
    
  2. Save the file or trigger auto formatting.

Expected Behavior

The formatter should retain the original spacing without inserting any additional spaces, preserving the integrity of the code:

func handleDeath() -> void:
    var signalConnections: Array[Dictionary] = self.get_incoming_connections()
    for connection in signalConnections:
        connection.signal.disconnect(connection.callable)

Current Behavior

After formatting, the script incorrectly introduces spaces around the dot notation, which can potentially lead to syntax errors:

func handleDeath() -> void:
    var signalConnections: Array[Dictionary] = self.get_incoming_connections()
    for connection in signalConnections:
        connection. signal .disconnect(connection.callable)
@sivercone sivercone added the bug label Sep 28, 2024
DaelonSuzuka added a commit to DaelonSuzuka/godot-vscode-plugin that referenced this issue Nov 3, 2024
@DaelonSuzuka
Copy link
Collaborator

This should be fixed in the next release.

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

2 participants