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

INT: handle conversion of module to self in nest use intention #3503

Merged
merged 1 commit into from
Mar 9, 2019

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented Mar 9, 2019

This PR fixes an error in the Nest use statements intention mentioned here: #2577 (comment).

Before the intention would change this code:

use foo;
use foo::bar;

into

use foo::{foo, bar}`;

which is incorrect.

Now it checks if the grouped path is the same as the base path and converts it to self if necessary.

@vlad20012
Copy link
Member

Thanks!
bors r+

@mchernyavsky mchernyavsky added this to the v94 milestone Mar 9, 2019
@mchernyavsky mchernyavsky added the fix Pull requests that fix some bug(s) label Mar 9, 2019
bors bot added a commit that referenced this pull request Mar 9, 2019
3501: INT: Make "unelide lifetimes" intention unavailable in doc comments r=vlad20012 a=vlad20012

It can be too annoying that this intention is available
inside all doctest injections

3503: INT: handle conversion of module to self in nest use intention r=vlad20012 a=Kobzol

This PR fixes an error in the `Nest use statements` intention mentioned here: #2577 (comment).

Before the intention would change this code:
```
use foo;
use foo::bar;
```
into
```
use foo::{foo, bar}`;
```
which is incorrect.

Now it checks if the grouped path is the same as the base path and converts it to `self` if necessary.

Co-authored-by: vlad20012 <beskvlad@gmail.com>
Co-authored-by: Jakub Beránek <berykubik@gmail.com>
@bors
Copy link
Contributor

bors bot commented Mar 9, 2019

@bors bors bot merged commit dfaec97 into intellij-rust:master Mar 9, 2019
@Kobzol Kobzol deleted the int-2577 branch March 9, 2019 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix some bug(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants