mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use enlarged use scope for determining whether in-place rename is applicable
This commit is contained in:
@@ -95,7 +95,7 @@ public class JavaRefactoringSupportProvider extends DefaultRefactoringSupportPro
|
||||
if (!(elementToRename instanceof PsiVariable)) return false;
|
||||
if (nameSuggestionContext != null && nameSuggestionContext.getContainingFile() != elementToRename.getContainingFile()) return false;
|
||||
if (!(elementToRename instanceof PsiLocalVariable) && !(elementToRename instanceof PsiParameter)) return false;
|
||||
SearchScope useScope = elementToRename.getUseScope();
|
||||
SearchScope useScope = elementToRename.getManager().getSearchHelper().getUseScope(elementToRename);
|
||||
if (!(useScope instanceof LocalSearchScope)) return false;
|
||||
PsiElement[] scopeElements = ((LocalSearchScope) useScope).getScope();
|
||||
if (scopeElements.length > 1 && // assume there are no elements with use scopes with holes in'em
|
||||
|
||||
Reference in New Issue
Block a user