-
Notifications
You must be signed in to change notification settings - Fork 571
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
Rename import alias #1813
Rename import alias #1813
Conversation
f0d8544
to
40a8ecb
Compare
Please squash all your commit into one. |
40a8ecb
to
bcc9124
Compare
I've done some resolve fixes and squashed everything into a single commit. |
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class GoRenameImportSpecProcessor extends RenamePsiElementProcessor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why're you need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To handle a dot import, couldn't find other way to prevent it from starting renaming and getting exception in MemberInplaceRenamer.
A possible solution is to resolve a dot symbol itself to the import path directory but I don't like the idea and seems like it will lead to another overriding named element logic for import specs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A possible solution is to resolve a dot symbol itself to the import path directory but I don't like the idea and seems like it will lead to another overriding named element logic for import specs.
Yep, it sounds not good. But renaming directory staying on dot is quite strange too. Maybe just restrict renaming of dot? Is this true that if this method returns null
then rename refactoring is considered as impossible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
substituteElementToRename
doc says:
@return the element to rename, or null if the rename refactoring should be canceled.
It may show a popup when user tries to rename a dot and return null
if you agree with such logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thinks it's good
bcc9124
to
d205709
Compare
Added dot renaming case test. |
d205709
to
1c1edc6
Compare
Added popup for dot import case, squashed into single commit. |
ba123af
to
4bc2b52
Compare
4bc2b52
to
dd3e64d
Compare
No description provided.