[groovy] get rid of CallInfo#getHighlightElementForCategoryQualifier

This commit is contained in:
Dmitry Trofimov
2017-09-28 21:18:31 +02:00
committed by Daniil Ovchinnikov
parent 01e038aef4
commit f06ba6a9a3
9 changed files with 27 additions and 188 deletions
@@ -1,18 +1,6 @@
/*
* Copyright 2000-2014 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.assignment;
import com.intellij.psi.PsiElement;
@@ -39,9 +27,6 @@ public interface CallInfo<Call extends GroovyPsiElement> {
@Nullable
PsiType getQualifierInstanceType();
@NotNull
PsiElement getHighlightElementForCategoryQualifier() throws UnsupportedOperationException;
@NotNull
PsiElement getElementToHighlight();
@@ -1,18 +1,6 @@
/*
* Copyright 2000-2014 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.assignment;
import com.intellij.psi.PsiElement;
@@ -57,12 +45,6 @@ public class DelegatingCallInfo<T extends GroovyPsiElement> implements CallInfo<
return myDelegate.getQualifierInstanceType();
}
@NotNull
@Override
public PsiElement getHighlightElementForCategoryQualifier() throws UnsupportedOperationException {
return myDelegate.getHighlightElementForCategoryQualifier();
}
@NotNull
@Override
public PsiElement getElementToHighlight() {
@@ -1,18 +1,6 @@
/*
* Copyright 2000-2014 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.assignment;
import com.intellij.psi.PsiElement;
@@ -60,12 +48,6 @@ public class GrBinaryExprInfo implements CallInfo<GrBinaryExpression> {
return myExpr.getLeftOperand().getType();
}
@NotNull
@Override
public PsiElement getHighlightElementForCategoryQualifier() {
return myExpr.getOperationToken();
}
@NotNull
@Override
public PsiElement getElementToHighlight() {
@@ -1,18 +1,6 @@
/*
* Copyright 2000-2014 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.assignment;
import com.intellij.psi.PsiElement;
@@ -47,12 +35,6 @@ public class GrConstructorInvocationInfo extends ConstructorCallInfoBase<GrConst
return getInvokedExpression().getType();
}
@NotNull
@Override
public PsiElement getHighlightElementForCategoryQualifier() {
throw new UnsupportedOperationException("not applicable");
}
@NotNull
@Override
public PsiElement getElementToHighlight() {
@@ -1,18 +1,6 @@
/*
* Copyright 2000-2014 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.assignment;
import com.intellij.psi.PsiElement;
@@ -54,12 +42,6 @@ public class GrEnumConstantInfo extends ConstructorCallInfoBase<GrEnumConstant>
return null;
}
@NotNull
@Override
public PsiElement getHighlightElementForCategoryQualifier() {
throw new UnsupportedOperationException("not applicable");
}
@NotNull
@Override
public PsiElement getElementToHighlight() {
@@ -1,18 +1,6 @@
/*
* Copyright 2000-2017 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.assignment
import com.intellij.psi.PsiElement
@@ -42,7 +30,6 @@ class GrIndexPropertyInfo(private val myCall: GrIndexProperty, private val rhs:
override fun multiResolve(): Array<GroovyResolveResult> = myCall.multiResolve(rhs)
override fun getHighlightElementForCategoryQualifier(): PsiElement = TODO("not supported")
override fun getExpressionArguments() = TODO("not supported")
override fun getClosureArguments() = TODO("not supported")
override fun getNamedArguments() = TODO("not supported")
@@ -1,18 +1,6 @@
/*
* Copyright 2000-2017 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.assignment;
import com.intellij.psi.PsiClass;
@@ -77,12 +65,6 @@ public class GrListOrMapInfo implements ConstructorCallInfo<GrListOrMap> {
return null;
}
@NotNull
@Override
public PsiElement getHighlightElementForCategoryQualifier() throws UnsupportedOperationException {
throw new UnsupportedOperationException("not applicable");
}
@NotNull
@Override
public PsiElement getElementToHighlight() {
@@ -1,18 +1,6 @@
/*
* Copyright 2000-2014 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.assignment;
import com.intellij.psi.PsiElement;
@@ -48,19 +36,6 @@ public class GrMethodCallInfo extends CallInfoBase<GrMethodCall> implements Call
return invoked instanceof GrReferenceExpression ? PsiImplUtil.getQualifierType((GrReferenceExpression)invoked) : null;
}
@NotNull
@Override
public PsiElement getHighlightElementForCategoryQualifier() {
GrExpression invoked = getCall().getInvokedExpression();
if (invoked instanceof GrReferenceExpression) {
PsiElement nameElement = ((GrReferenceExpression)invoked).getReferenceNameElement();
if (nameElement != null) {
return nameElement;
}
}
return invoked;
}
@NotNull
@Override
public PsiElement getElementToHighlight() {
@@ -1,18 +1,6 @@
/*
* Copyright 2000-2014 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.assignment;
import com.intellij.psi.PsiElement;
@@ -50,12 +38,6 @@ public class GrNewExpressionInfo extends ConstructorCallInfoBase<GrNewExpression
return null;
}
@NotNull
@Override
public PsiElement getHighlightElementForCategoryQualifier() {
throw new UnsupportedOperationException("no categories are applicable to new expression");
}
@NotNull
@Override
public PsiElement getElementToHighlight() {