mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
speed up python class rename (restricted search scope for __init__)
This commit is contained in:
@@ -17,6 +17,7 @@ package com.jetbrains.python.refactoring.rename;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiReference;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.searches.ReferencesSearch;
|
||||
import com.intellij.util.Processor;
|
||||
import com.jetbrains.python.PyNames;
|
||||
@@ -67,7 +68,7 @@ public class RenamePyClassProcessor extends RenamePyElementProcessor {
|
||||
if (initMethod != null) {
|
||||
final List<PsiReference> allRefs = Collections.synchronizedList(new ArrayList<PsiReference>());
|
||||
allRefs.addAll(super.findReferences(element));
|
||||
ReferencesSearch.search(initMethod).forEach(new Processor<PsiReference>() {
|
||||
ReferencesSearch.search(initMethod, GlobalSearchScope.projectScope(element.getProject())).forEach(new Processor<PsiReference>() {
|
||||
@Override
|
||||
public boolean process(PsiReference psiReference) {
|
||||
if (psiReference.getCanonicalText().equals(((PyClass)element).getName())) {
|
||||
|
||||
Reference in New Issue
Block a user