mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Verify that PyFindUsagesHandlerFactory.proxy overrides all the necessary methods (PY-41790)
Leave comments in all related places to reduce possible regressions in the future. GitOrigin-RevId: d4fbe3e75f67a1ec0f94e7a7ed6c58d2dbf6a1e7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e93976f8fc
commit
b017f822c2
+1
-1
@@ -20,7 +20,7 @@ import com.jetbrains.python.psi.PyClass;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
* Important note: please update PyFindUsagesHandlerFactory#proxy on any changes here.
|
||||
*/
|
||||
public class PyClassFindUsagesHandler extends PyFindUsagesHandler {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Yuli Fiterman
|
||||
* Important note: please update PyFindUsagesHandlerFactory#proxy on any changes here.
|
||||
*/
|
||||
public abstract class PyFindUsagesHandler extends FindUsagesHandlerBase {
|
||||
protected PyFindUsagesHandler(@NotNull PsiElement psiElement) {
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
* Important note: please update PyFindUsagesHandlerFactory#proxy on any changes here.
|
||||
*/
|
||||
public class PyFunctionFindUsagesHandler extends PyFindUsagesHandler {
|
||||
private final List<PsiElement> myAllElements;
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
* Important note: please update PyFindUsagesHandlerFactory#proxy on any changes here.
|
||||
*/
|
||||
public class PyModuleFindUsagesHandler extends PyFindUsagesHandler {
|
||||
final PsiFileSystemItem myElement;
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import com.jetbrains.python.psi.PyTargetExpression;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Mikhail Golubev
|
||||
* Important note: please update PyFindUsagesHandlerFactory#proxy on any changes here.
|
||||
*/
|
||||
public class PyTargetExpressionFindUsagesHandler extends PyFindUsagesHandler {
|
||||
public PyTargetExpressionFindUsagesHandler(@NotNull PyTargetExpression psiElement) {
|
||||
|
||||
@@ -16,9 +16,12 @@
|
||||
package com.jetbrains.python.findUsages;
|
||||
|
||||
import com.intellij.find.findUsages.*;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFileSystemItem;
|
||||
import com.intellij.psi.PsiReference;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import com.intellij.ui.SimpleColoredComponent;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
import com.jetbrains.python.PyBundle;
|
||||
@@ -26,6 +29,8 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author traff
|
||||
*/
|
||||
@@ -41,10 +46,12 @@ public class PyFindUsagesHandlerFactory extends FindUsagesHandlerFactory impleme
|
||||
return (FindUsagesHandler)base;
|
||||
}
|
||||
else if (base instanceof PyFindUsagesHandler) {
|
||||
// Important note: override methods that are overridden in PyFindUsagesHandler inheritors.
|
||||
|
||||
return new FindUsagesHandler(base.getPsiElement()) {
|
||||
@Override
|
||||
public @NotNull FindUsagesOptions getFindUsagesOptions() {
|
||||
return base.getFindUsagesOptions();
|
||||
public @NotNull FindUsagesOptions getFindUsagesOptions(@Nullable DataContext dataContext) {
|
||||
return base.getFindUsagesOptions(dataContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,6 +64,12 @@ public class PyFindUsagesHandlerFactory extends FindUsagesHandlerFactory impleme
|
||||
return base.getPrimaryElements();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Collection<PsiReference> findReferencesToHighlight(@NotNull PsiElement target,
|
||||
@NotNull SearchScope searchScope) {
|
||||
return base.findReferencesToHighlight(target, searchScope);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull AbstractFindUsagesDialog getFindUsagesDialog(boolean isSingleFile,
|
||||
boolean toShowInNewTab,
|
||||
@@ -87,6 +100,9 @@ public class PyFindUsagesHandlerFactory extends FindUsagesHandlerFactory impleme
|
||||
return new PyModuleFindUsagesHandlerUi(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Important note: please update PyFindUsagesHandlerFactory#proxy on any changes here.
|
||||
*/
|
||||
static class PyModuleFindUsagesHandlerUi extends PyModuleFindUsagesHandler implements FindUsagesHandlerUi {
|
||||
protected PyModuleFindUsagesHandlerUi(@NotNull PsiFileSystemItem file) {
|
||||
super(file);
|
||||
|
||||
Reference in New Issue
Block a user