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

named function arguments #586

Open
khvorov45 opened this issue Aug 1, 2023 · 7 comments
Open

named function arguments #586

khvorov45 opened this issue Aug 1, 2023 · 7 comments
Labels

Comments

@khvorov45
Copy link

Before formatting

void temp(int v1, int v2) {}

void main() {
    temp(v1: 1, v2: 2);
    temp(
        v1: 1, 
        v2: 2,
    );
}

After formatting

void temp(int v1, int v2) {
}

void main() {
    temp(v1 : 1, v2:
        2);
    temp(
v1 : 1,
v2:
        2,
    );
}
@WebFreak001 WebFreak001 added the bug label Aug 1, 2023
@danielzuncke
Copy link
Contributor

Would you like to have the option to choose between temp(v1: 1, v2: 2) and temp(v1 : 1, v2 : 2) like with --space_before_aa_colon=false or not?

@khvorov45
Copy link
Author

I'd like the option, sure.

@WebFreak001
Copy link
Member

makes sense for consistency and formatting code is likely to be the same as AA as well

danielzuncke added a commit to danielzuncke/dfmt that referenced this issue Oct 26, 2023
WebFreak001 pushed a commit that referenced this issue Oct 26, 2023
@redthing1
Copy link

I'm still having this issue in vscode, is my dfmt too old or something? My extension is up to date.

@WebFreak001
Copy link
Member

did you enable beta/nightly branch for serve-d?

Try upgrading to serve-d nightly by setting the d.servedReleaseChannel setting in vscode (Ctrl-, for User Settings) to nightly - afterwards, reload the window with Ctrl-Shift-P -> Reload Window and let it automatically download the update.

@FeepingCreature
Copy link
Contributor

FeepingCreature commented Jan 31, 2024

I'm still seeing this issue with dfmt master.

Source:

void test() {
    return Struct(
        foo: field.foo,
        bar: field.bar,
        baz: field.baz);
}

dfmt --keep_line_breaks=true test.d:

void test()
{
    return Struct(
foo: field.foo,
bar: field.bar,
baz: field.baz);
}

@redthing1
Copy link

I am seeing the same thing as well, with the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants