mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
rename failure fixed: incomplete references on fields are now processed by VariableInIncompleteCodeSearcher
This commit is contained in:
+6
-3
@@ -37,13 +37,16 @@ public class VariableInIncompleteCodeSearcher extends QueryExecutorBase<PsiRefer
|
||||
@Override
|
||||
public void processQuery(@NotNull final ReferencesSearch.SearchParameters p, @NotNull final Processor<PsiReference> consumer) {
|
||||
final PsiElement refElement = p.getElementToSearch();
|
||||
if (!refElement.isValid() || !(refElement instanceof PsiLocalVariable || refElement instanceof PsiParameter)) return;
|
||||
if (!refElement.isValid() || !(refElement instanceof PsiVariable)) return;
|
||||
|
||||
final String name = ((PsiVariable)refElement).getName();
|
||||
if (name == null) return;
|
||||
|
||||
final SearchScope scope = p.getEffectiveSearchScope();
|
||||
if (!(scope instanceof LocalSearchScope)) return;
|
||||
SearchScope scope = p.getEffectiveSearchScope();
|
||||
if (!(scope instanceof LocalSearchScope)) {
|
||||
//process incomplete references to the 'field' in the same file only
|
||||
scope = new LocalSearchScope(refElement.getContainingFile());
|
||||
}
|
||||
|
||||
PsiElement[] elements = ((LocalSearchScope)scope).getScope();
|
||||
if (elements.length == 0) return;
|
||||
|
||||
Reference in New Issue
Block a user