godot-vscode-plugin
godot-vscode-plugin copied to clipboard
Auto Formatter Incorrectly Adding Spaces Around Dot Notation
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
-
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) -
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)
This should be fixed in the next release.