Skip to content

fix_dangling_commas removes new lines from multiline strings #79

@shadr

Description

@shadr

Introduced in bdd2bcb
Input:

func _ready() -> void:
	var a = """
	first line
	,
	second line
	"""

Output:

func _ready() -> void:
	var a = """
	first line,
	second line
	"""

We can use a tree-sitter method to get a node in which a comma was found and check if it's not a string. This will require to use captures_iter and expand instead of replace_all
P.S. not sure why anyone would need to have an indented comma in a multiline string, but hey it's technically a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions