Extract search action name
This commit is contained in:
@@ -257,9 +257,11 @@ usageType.selector = Selector
|
|||||||
|
|
||||||
x.in.y={0} in {1}
|
x.in.y={0} in {1}
|
||||||
x.implements.y={0} in {1} implements {2} in {3}.
|
x.implements.y={0} in {1} implements {2} in {3}.
|
||||||
x.overrides.y.in.class.list={0} in {1} overrides functions in the following classes/traits: {2} Do you want to delete (with usage search) the base methods?
|
x.overrides.y.in.class.list={0} in {1} overrides functions in the following classes/traits: {2} Do you want to {3} the base methods?
|
||||||
|
|
||||||
unused.overriding.methods.title=Unused Overriding Members
|
unused.overriding.methods.title=Unused Overriding Members
|
||||||
there.are.unused.methods.that.override.methods.you.delete=There are unused members that override methods you delete.
|
there.are.unused.methods.that.override.methods.you.delete=There are unused members that override methods you delete.
|
||||||
choose.the.ones.you.want.to.be.deleted=Choose the ones you want to be deleted.
|
choose.the.ones.you.want.to.be.deleted=Choose the ones you want to be deleted.
|
||||||
method.column=Member
|
method.column=Member
|
||||||
delete.param.in.method.hierarchy={0} is a part of method hierarchy. Do you want to delete multiple parameters?
|
delete.param.in.method.hierarchy={0} is a part of method hierarchy. Do you want to delete multiple parameters?
|
||||||
|
super.methods.delete.with.usage.search=delete (with usage search)
|
||||||
@@ -117,7 +117,7 @@ public class JetRefactoringUtil {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static Collection<? extends PsiElement> checkSuperMethods(
|
public static Collection<? extends PsiElement> checkSuperMethods(
|
||||||
@NotNull JetDeclaration declaration, @Nullable Collection<PsiElement> ignore
|
@NotNull JetDeclaration declaration, @Nullable Collection<PsiElement> ignore, @NotNull String actionStringKey
|
||||||
) {
|
) {
|
||||||
final BindingContext bindingContext =
|
final BindingContext bindingContext =
|
||||||
AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) declaration.getContainingFile()).getBindingContext();
|
AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) declaration.getContainingFile()).getBindingContext();
|
||||||
@@ -144,7 +144,7 @@ public class JetRefactoringUtil {
|
|||||||
if (superMethods.isEmpty()) return Collections.singletonList(declaration);
|
if (superMethods.isEmpty()) return Collections.singletonList(declaration);
|
||||||
|
|
||||||
java.util.List<String> superClasses = getClassDescriptions(bindingContext, superMethods);
|
java.util.List<String> superClasses = getClassDescriptions(bindingContext, superMethods);
|
||||||
return askUserForMethodsToSearch(declaration, callableDescriptor, superMethods, superClasses);
|
return askUserForMethodsToSearch(declaration, callableDescriptor, superMethods, superClasses, actionStringKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -152,14 +152,16 @@ public class JetRefactoringUtil {
|
|||||||
@NotNull JetDeclaration declaration,
|
@NotNull JetDeclaration declaration,
|
||||||
@NotNull CallableMemberDescriptor callableDescriptor,
|
@NotNull CallableMemberDescriptor callableDescriptor,
|
||||||
@NotNull Collection<? extends PsiElement> superMethods,
|
@NotNull Collection<? extends PsiElement> superMethods,
|
||||||
@NotNull List<String> superClasses
|
@NotNull List<String> superClasses,
|
||||||
|
@NotNull String actionStringKey
|
||||||
) {
|
) {
|
||||||
String superClassesStr = "\n" + StringUtil.join(superClasses, "");
|
String superClassesStr = "\n" + StringUtil.join(superClasses, "");
|
||||||
String message = JetBundle.message(
|
String message = JetBundle.message(
|
||||||
"x.overrides.y.in.class.list",
|
"x.overrides.y.in.class.list",
|
||||||
DescriptorRenderer.COMPACT.render(callableDescriptor),
|
DescriptorRenderer.COMPACT.render(callableDescriptor),
|
||||||
DescriptorRenderer.SOURCE_CODE_SHORT_NAMES_IN_TYPES.render(callableDescriptor.getContainingDeclaration()),
|
DescriptorRenderer.SOURCE_CODE_SHORT_NAMES_IN_TYPES.render(callableDescriptor.getContainingDeclaration()),
|
||||||
superClassesStr
|
superClassesStr,
|
||||||
|
JetBundle.message(actionStringKey)
|
||||||
);
|
);
|
||||||
|
|
||||||
int exitCode = Messages.showYesNoCancelDialog(
|
int exitCode = Messages.showYesNoCancelDialog(
|
||||||
|
|||||||
+3
-1
@@ -790,7 +790,9 @@ public class KotlinSafeDeleteProcessor extends JavaSafeDeleteProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (element instanceof JetNamedFunction || element instanceof JetProperty) {
|
if (element instanceof JetNamedFunction || element instanceof JetProperty) {
|
||||||
return JetRefactoringUtil.checkSuperMethods((JetDeclaration) element, allElementsToDelete);
|
return JetRefactoringUtil.checkSuperMethods(
|
||||||
|
(JetDeclaration) element, allElementsToDelete, "super.methods.delete.with.usage.search"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getElementsToSearch(element, module, allElementsToDelete);
|
return super.getElementsToSearch(element, module, allElementsToDelete);
|
||||||
|
|||||||
Reference in New Issue
Block a user