Android Studio Refactoring/Find Usages Scope is always "Modules with dependents, scratches and consoles"
I just discovered that Android Studio 3.6.3, and most likely 4, ignore the selected refactoring and find usages scope and always use “Modules with dependents, scratches and consoles” even if “All Places” or “Project Files” is selected.
This causes a problem for Markdown Navigator refactoring because often the markdown files are in the project scope but not in any module. Resulting in links to Java and Kotlin files not being refactored or shown in find usages.
If the markdown file is placed under a module then everything works as expected.
Files such as version history or README are usually at the project root and not in any module and moving them to a module is not possible.
This works correctly in all JetBrains IDEs which I tested, so my money is on it being an Android Studio bug.
Where would I file an issue for AS to have this either addressed or help me find a solution which I can implement in my plugin without needing an AS fix?
Please sign in to leave a comment.
The culprit is in RenameUtil.findUsages which ignores the passed in scope and always uses its own scope based on the element, since element scope intersected with project scope will be the element scope:
Hey there! For Android Studio issues, you should file a bug on the Google Issuetracker. There are further details about the process here: https://developer.android.com/studio/report-bugs
If you want to jump straight to the issue tracker: https://issuetracker.google.com/issues/new?component=192708&template=840533
Thank Sebastiano. The user who discovered this issue, opened one on AS issue tracker in this case. Next time I will open one myself.
I am not looking forward to the increases in differences in the API nuances between JetBrains IDE and AS. Having a plugin not only per version of JetBrains IDEs but also per version of AS will make the maintenance effort that much greater.
That's something I don't have a comment on, I don't work on the IJ team and I don't work at Google either... it's a comment you should probably take on with Google though :)
I will open a new topic since this issue is now in the SNAPSHOT build from latest intellij-community master.