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

Add mod declaration after the last availaible in the file when performing "Attach file to main.rs" action #5903

Closed
avrong opened this issue Aug 10, 2020 · 1 comment · Fixed by #5937
Assignees
Labels
improvement subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc.

Comments

@avrong
Copy link
Member

avrong commented Aug 10, 2020

Environment

  • IntelliJ Rust plugin version: 0.3.127.3249-202
  • Rust toolchain version: 1.45.2 (d3fb005a3 2020-07-31) x86_64-apple-darwin
  • IDE name and version: CLion 2020.2 (CL-202.6397.106)
  • Operating system: macOS 10.15.6

Problem description

I believe that the better option will be to add the new mod declaration right after the last one available if it is present. It will reduce the following manual editing.

Optimize Imports action doesn't solve the problem completely.

Expected result

use std::path::Path;

use module::whatever;

mod module;
mod new_module;

fn main() {...}
@Kobzol
Copy link
Member

Kobzol commented Aug 10, 2020

I wanted to do this in the original PR, but didn't get to it. I think that this is a good idea.

@Kobzol Kobzol added improvement subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc. labels Aug 10, 2020
@Kobzol Kobzol self-assigned this Aug 10, 2020
@bors bors bot closed this as completed in 6537a1e Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants