Closed edwardloveall closed 1 year ago
Thank you for reporting this issue! Thanks also for all the detail and letting me know what you've tried. I'll admit I haven't been good about including a rustfmt.toml
in recent projects so I didn't experience this bug. 😅
You were close to the source, but the real issue was this conditional. In one case I return the file path, and in another I return a directory path. I must have been careless when I tried to get format on save to find the Rust edition for the project (rustfmt
defaults to 2015 edition for some reason).
Fix is coming shortly!
Amazing, and thank you! Updated and it works great. I'll close the issue.
Describe the bug
When formatting on save, my custom rustfmt settings set in
rustfmt.toml
at the root of the project are not respected. I think this code in rust-formatter.ts is the culprit. If I do something similar in a javascript console I get the parent directory:To Reproduce Steps to reproduce the behavior:
cargo new test-project
cd test-project
echo 'tab_spaces = 2' > rustfmt.toml
(or whatever format that's not standard)nova .
src/main.rs
Expected behavior
The 4-space indent becomes a 2-space indent
Versions (please complete the following information):
Additional context
I was able to get this to work if I put the
rustfmt.toml
in the directory above my project directory. I thought that maybe the project was expecting the dir to have a slash at the end, so I tried opening it withnova ./
instead of my normalnova .
but that didn't help.I also tried to run the extension locally, but typescript would not build on account of some mismatched nova types.