krasa / StringManipulation

IntelliJ plugin - https://plugins.jetbrains.com/plugin/2162
Apache License 2.0
694 stars 81 forks source link

Whether renaming constants or member variables using plug-ins can affect the renaming and modification of those used #186

Closed springandme closed 2 years ago

springandme commented 2 years ago

Example I want to rename constants「full_name」to 「FULL_NAME」, However, the following constants are not modified

public class UserInfoTest {
    public static final String full_name = "llhuang10";
    public void test() {
        UserInfo userInfo = UserInfo.builder()
                    .name(full_name)
                        .build();
    }
}

Expect

public class UserInfoTest {
    public static final String FULL_NAME = "llhuang10";
    public void test() {
        UserInfo userInfo = UserInfo.builder()
                    .name(FULL_NAME)
                        .build();
    }
}

Actual

public class UserInfoTest {
    public static final String FULL_NAME = "llhuang10";
    public void test() {
        UserInfo userInfo = UserInfo.builder()
                    .name(full_name)
                        .build();
    }
}
krasa commented 2 years ago

how are you renaming it? By Main Menu | Refactor | Rename...?

springandme commented 2 years ago

just use this plugin Atl + M image

krasa commented 2 years ago

That's not how any of this works. Either use 'Rename', or select all occurrences.

springandme commented 2 years ago

yes, I have seen 「 select all occurrences」 option. thank for your answer, this issue can close ^_^