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

Mapwrap #675

Closed
JasperHorn opened this issue Aug 3, 2023 · 0 comments
Closed

Mapwrap #675

JasperHorn opened this issue Aug 3, 2023 · 0 comments
Labels
enhancement New feature or request wrapping Incorrect or undesirable wrapping

Comments

@JasperHorn
Copy link

Describe the Feature

Currently map literals ([key1 => value1, key2 => value2]) are formatted according to the wrapping.arrayWrap configuration. As far as I can tell, there is no way to format map literals different from array literals, which can definitely be a sensible thing to do (for example: leave array mapping as default, but use onePerLine for map literals).

Sample of desired output

{
    "wrapping": {
        "arrayWrapping": {
            "defaultWrap": "noWrap"
        },
        "mapWrapping": {
            "defaultWrap": "onePerLine"
       }
}
class Main {
    private var array:Array<String> = ["a", "b", "c"];

    private var map:Map<String, String> = [
        "a" => "apple",
        "b" => "bear",
        "c" => "callsign"
    ];
}
@AlexHaxe AlexHaxe added enhancement New feature or request wrapping Incorrect or undesirable wrapping labels Aug 3, 2023
AlexHaxe added a commit to AlexHaxe/haxe-formatter that referenced this issue Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wrapping Incorrect or undesirable wrapping
Projects
None yet
Development

No branches or pull requests

2 participants