Skip to content

tryCatch: next with single-line try-catch #509

@Gama11

Description

@Gama11

Describe the bug

This seems broken - for single-line try-catch expressions, the setting should probably not apply?

Input file

class Main {
	static function main() {
		var applicationName = try ProjectUtils.getApplicationFile(FileSystem.fullPath(project.projectXmlPath)) catch (_:Dynamic) project.name;
	}
}

Broken output

class Main {
	static function main() {
		var applicationName = try ProjectUtils.getApplicationFile(FileSystem.fullPath(project.projectXmlPath))
		catch (_:Dynamic) project.name;
	}
}

Optional: hxformat.json

{
	"sameLine": {
		"tryCatch": "next"
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsamelinebroken same line formatting

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions