Rename/refactor operations should update/check BUILD.bazel files too. #6211
Labels
awaiting-maintainer
Awaiting review from Bazel team on issues
P3
We're not considering working on this, but happy to review a PR. (No assignee)
product: IntelliJ
IntelliJ plugin
type: feature request
Description of the feature request:
This would be a feature for file-level operations and language-definition operations. If I rename a class in IntelliJ, IJ will rename the
.java
file to match, and it will also change the names of all references in Java code. However, even if that file is referenced directly in a BUILD.bazel file, it is not renamed. Ideally, the name change would take place everywhere. it is as though the BUILD.bazel is invisible to the operation.Similarly, if I rename or delete a file (like a/b/c/Tiltfile), when I delete the file, IJ will prompt me to do a safe delete, looking for usages and appearances in text strings. It does not treat the specific usage in a BUILD.bazel file as a "usage", so if I choose only that option on safe delete, no warning will be raised. If I enable the check in comments and strings, it will actually miss it in the BUILD.bazel that uses the Tiltfile and find it in other random BUILD.bazel files (but not all of them, and not all places in the repo). I suspect a general IJ bug since it was not finding references elsewhere in the repo.
When I safe-delete a file, the Bazel add in will point out globs that include the file. For example,
src/**/*..java
. This is rather useless, I would rather that did not happen. It tells me that there is some interpretation of BUILD.bazel, so I am surprised it's not thorough enough to catch non-glob usages.Without this feature, many refactorings that I perform require manual searching of references in BUILD.bazel files, which is the same experience as not using an IDE in the first place.
Which category does this issue belong to?
Intellij
What underlying problem are you trying to solve with this feature?
Developer productivity
What operating system, Intellij IDE and programming languages are you using? Please provide specific versions.
MacOS Sonoma 14.1, IJ 2023.4, Java and golang
Have you found anything relevant by searching the web?
I have looked and seen nothing
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: