mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
slightly better code for unable to rename test
This commit is contained in:
@@ -84,15 +84,14 @@ public class PsiElementRenameHandler implements RenameHandler {
|
||||
rename(element, project, nameSuggestionContext, editor);
|
||||
}
|
||||
|
||||
public static boolean canRename(Project project, Editor editor, PsiElement element) {
|
||||
static boolean canRename(Project project, Editor editor, PsiElement element) {
|
||||
if (element == null) return false;
|
||||
if (!(element instanceof PsiFile) && CollectHighlightsUtil.isOutsideSourceRootJavaFile(element.getContainingFile())) return false;
|
||||
|
||||
if (!element.isWritable()) {
|
||||
String message = RefactoringBundle.getCannotRefactorMessage("This element cannot be renamed.");
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
showErrorMessage(project, editor, message);
|
||||
}
|
||||
showErrorMessage(project, editor, message);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user