rust-analyzer/crates/ra_assists/src
bors[bot] b952c270ee Merge #762
762: "Dumb" auto import assist r=matklad a=eulerdisk

This adds a new assist to "add xxx::yyy to the current file" when the cursor is on a PATH. It manages correctly nested imports,`self` keyword and creates new nested imports if necessary. [See the tests]
It doesn't use name resolution so in that sense is 'dumb', but I have plans to do that. That in the future will be useful to auto import trait names in autocompletion for example.

It can easily be extended to provide multiple actions to select in which scope to import. That's another thing I plan to do.

@matklad I copied some indentation code from `ide_light`, I don't know at the moment if/how you want to refactor that code. This assist was meant to be in `ide_light`.

Co-authored-by: Andrea Pretto <eulerdisk@gmail.com>
2019-02-10 19:00:36 +00:00
..
add_derive.rs Add tests for action target ranges 2019-02-09 00:34:26 +01:00
add_impl.rs Add tests for action target ranges 2019-02-09 00:34:26 +01:00
assist_ctx.rs Merge #766 2019-02-09 09:56:54 +00:00
auto_import.rs auto_import: use ra_fmt 2019-02-09 11:47:23 +01:00
change_visibility.rs Add tests for action target ranges 2019-02-09 00:34:26 +01:00
fill_match_arms.rs Add tests for action target ranges 2019-02-09 00:34:26 +01:00
flip_comma.rs Add tests for action target ranges 2019-02-09 00:34:26 +01:00
introduce_variable.rs Fix introduce var duplicating newlines 2019-02-09 13:52:01 +02:00
lib.rs auto_import assist 2019-02-09 11:29:59 +01:00
remove_dbg.rs Add tests for action target ranges 2019-02-09 00:34:26 +01:00
replace_if_let_with_match.rs Merge #766 2019-02-09 09:56:54 +00:00
split_import.rs Add tests for action target ranges 2019-02-09 00:34:26 +01:00