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

Request: "Compressed" #5218

Open
Lokathor opened this issue Feb 5, 2022 · 2 comments · May be fixed by #5337
Open

Request: "Compressed" #5218

Lokathor opened this issue Feb 5, 2022 · 2 comments · May be fixed by #5337

Comments

@Lokathor
Copy link

Lokathor commented Feb 5, 2022

Just how fn_args_layout works for function declarations, but make it work for function calls as well.

eg:

use super::*;

pub fn create_window_ex_w() {
  CreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
}

should become (depending on line with and such) something like this:

use super::*;

pub fn create_window_ex_w() {
  CreateWindowExW(dwExStyle, lpClassName, lpWindowName,
    dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu,
    hInstance, lpParam)
}

instead of going to a completely vertical layout.

@calebcartwright
Copy link
Member

This is technically a duplicate of #4146, however, that issue had a subtly massive scope since it covered both chains and calls (similar to #4306) and I was thinking about extracting a new issue focused on the call args piece.

Is your interest strictly in a compressed-like variant on calls, or would it be alright with you if we broaden this a tad to discuss the feasibility of a new option to cover call layout/style (naming will be fun given the unfortunate name of the existing option that actually controls params in fn items, not args in calls), with Compressed being a potential variant?

I suspect some of the original challenges (#2010) that prevented a compressed variant in the first place are still prevalent, but I wonder if some form of a preserve-variant similar to what we're targeting for chains could be possible as a middle ground.

@Lokathor
Copy link
Author

Uh, however you want it.

I just have these occasional FFI calls which have to match a particular many-args signature and rustfmt makes them take up half a page of space.

I have no opinions on if chains should be in scope or how they should work if they are. I just need normal function calls to work. That's the only time I'm stuck with this many args instead of combining them into an array or a args-struct or a builder or something else like that.

@ytmimi ytmimi linked a pull request May 8, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants