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

Support formatting async/await code #27

Closed
nsavch opened this issue Jan 8, 2019 · 5 comments
Closed

Support formatting async/await code #27

nsavch opened this issue Jan 8, 2019 · 5 comments

Comments

@nsavch
Copy link

nsavch commented Jan 8, 2019

Currently if you try to save async/await code you get a rustfmt error. In order to fix it you need to pass the argument "--edition 2018" to it (cargo fmt does it automatically). Unfortunately rustic dosen't allow to customize rustfmt options, only the binary path. Would be cool if there was a variable for customizing rustfmt options.

Thanks for your work, the mode is quite cool overall.

@brotzeit
Copy link
Owner

brotzeit commented Jan 9, 2019

Thanks for the bug report. I will take a look at it. But this feels like it should be handled by rustfmt similarly to cargo fmt. Do you know if this works with rust-mode ?

@nsavch
Copy link
Author

nsavch commented Jan 9, 2019

Cargo fmt just adds the "--edition 2018" argument to all rustfmt calls:

project » cargo fmt -v                                                                     
[bin (2018)] "/project/src/main.rs"
rustfmt --edition 2018 /project/src/main.rs

The original rust-mode fails to format with the same error as rustic.

@nsavch
Copy link
Author

nsavch commented Jan 9, 2019

Actually I found a workaround. You can create a .rustfmt.toml file and specify 2018 edition there. After that rustic auto format works again.

See example rustfmt.toml file here - https://github.com/rust-lang/rustfmt/blob/master/rustfmt.toml

@brotzeit
Copy link
Owner

brotzeit commented Jan 9, 2019

Ok. Let's leave this issue open for others.

@brotzeit
Copy link
Owner

I added a note in the readme.

tarsius pushed a commit to emacsmirror/rustic that referenced this issue Aug 4, 2024
org babel: Add test for the popup case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants