diff --git a/plugins/groovy/groovy-psi/resources/inspectionDescriptions/GrUnnecessaryAlias.html b/plugins/groovy/groovy-psi/resources/inspectionDescriptions/GrUnnecessaryAlias.html new file mode 100644 index 000000000000..b21e003f5ad0 --- /dev/null +++ b/plugins/groovy/groovy-psi/resources/inspectionDescriptions/GrUnnecessaryAlias.html @@ -0,0 +1,8 @@ + +
+Reports unnecessary import aliases ++ New in 2018.1 +
+ + diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.properties b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.properties index 641a39f21784..2c98f9bbf701 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.properties +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.properties @@ -121,4 +121,6 @@ expected.type.0=Expected ''{0}'', found ''{1}'' declare.explicit.implementations.of.trait=Declare explicit implementations of trait unnecessary.modifier.description=Modifier ''{0}'' is not necessary unnecessary.modifier.remove=Remove unnecessary ''{0}'' -unnecessary.def.explicitly.typed.only=Only report in explicitly typed declarations \ No newline at end of file +unnecessary.def.explicitly.typed.only=Only report in explicitly typed declarations +unnecessary.alias.fix=Remove unnecessary alias +unnecessary.alias.description=Alias is unnecessary \ No newline at end of file diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/fixes/RemoveElementQuickFix.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/fixes/RemoveElementQuickFix.java index b6de7c11b1e2..4c06dfddd29f 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/fixes/RemoveElementQuickFix.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/fixes/RemoveElementQuickFix.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.codeInspection.fixes; import com.intellij.codeInspection.LocalQuickFix; @@ -20,6 +6,7 @@ import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; import com.intellij.util.Function; +import com.intellij.util.Functions; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; @@ -28,6 +15,10 @@ public class RemoveElementQuickFix implements LocalQuickFix { private final String myName; private final Function