Scony / godot-gdscript-toolkit

Independent set of GDScript tools - parser, linter, formatter, and more
MIT License
983 stars 68 forks source link

Option to remove space before function name when wrapping multiline #266

Closed tavurth closed 9 months ago

tavurth commented 9 months ago
func set_shader_offset(at_position: Vector3) -> void:
    for key in ["base", "ridge", "river", "detail"]:
        %HeightmapRenderer\
            .get_material()\
            .get_shader_parameter("input_%s" % key)\
            .get_noise()\
            .set_offset(at_position * WorldHelper.CHUNK_SIZE)

Will become:

func set_shader_offset(at_position: Vector3) -> void:
    for key in ["base", "ridge", "river", "detail"]:
        (
            %HeightmapRenderer
            . get_material()
            . get_shader_parameter("input_%s" % key)
            . get_noise()
            . set_offset(
                at_position * WorldHelper.CHUNK_SIZE
            )
        )

I just would like to find a way to remove the . x space between the dot and the function name. Is this currently possible?

Scony commented 9 months ago

No - it's meant to be this way so that the style is uniform regardless of operator.

tavurth commented 9 months ago

I mean regardless of operator there will also always be a point and then a name?

Scony commented 9 months ago

Well, the dot is the operator just like any other like +, %, ==, and the likes. Therefore in the above case, there will always be a whitespace after the operator.