Skip to content

Context-aware range formatting #817

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

Closed
syml opened this issue Feb 10, 2016 · 3 comments
Closed

Context-aware range formatting #817

syml opened this issue Feb 10, 2016 · 3 comments

Comments

@syml
Copy link

syml commented Feb 10, 2016

Does rust support context-aware range formatting? From the command-line help it seems it's not the case.
If not can we have that as a feature?

@nrc
Copy link
Member

nrc commented Feb 10, 2016

Could you give an example of the kind of thing you want?

@syml
Copy link
Author

syml commented Feb 10, 2016

foo.rs:
struct Foo { bar: i32
}
struct Bar { baz: bool }

command:
cat foo.rs | rustfmt --lines=4-4

output:
struct Foo { bar: i32
}
struct Bar {
baz: bool
}

The idea is to be able to selectively format some lines. Most formatters support that, ex: clang-format.

@kamalmarhubi
Copy link
Contributor

See #434. I'm working on it at the moment.

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

No branches or pull requests

4 participants