diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/ResolveUtil.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/ResolveUtil.java index bc737e23ebd7..d89e380c0d9b 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/ResolveUtil.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/ResolveUtil.java @@ -907,17 +907,6 @@ public class ResolveUtil { } } - public static boolean canBeClass(final GrReferenceExpression ref) { - GrExpression qualifier = ref.getQualifier(); - if (qualifier instanceof GrReferenceExpression) { - final PsiElement resolvedQualifier = ((GrReferenceExpression)qualifier).resolve(); - return resolvedQualifier instanceof PsiClass || resolvedQualifier instanceof PsiPackage; - } - else { - return qualifier == null; - } - } - public static boolean canBeClassOrPackage(final GrReferenceExpression ref) { GrExpression qualifier = ref.getQualifier(); if (qualifier instanceof GrReferenceExpression) { diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/GroovyResolverProcessorBuilder.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/GroovyResolverProcessorBuilder.java index 73ea264b4289..03e523bcc976 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/GroovyResolverProcessorBuilder.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/GroovyResolverProcessorBuilder.java @@ -5,7 +5,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrMethodCall; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression; -import org.jetbrains.plugins.groovy.lang.resolve.ResolveUtil; import java.util.EnumSet; @@ -63,9 +62,9 @@ public final class GroovyResolverProcessorBuilder { if (ref.hasMemberPointer()) return EnumSet.of(METHOD); final EnumSet result = EnumSet.allOf(GroovyResolveKind.class); + result.remove(CLASS); result.remove(PACKAGE); - if (!ResolveUtil.canBeClass(ref)) result.remove(CLASS); if (ref.isQualified()) result.remove(BINDING); if (!(ref.getParent() instanceof GrMethodCall)) result.remove(METHOD); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/GroovyResolverProcessorImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/GroovyResolverProcessorImpl.java index b591a546a8c3..e4a1030e554d 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/GroovyResolverProcessorImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/GroovyResolverProcessorImpl.java @@ -52,11 +52,6 @@ class GroovyResolverProcessorImpl extends GroovyResolverProcessor implements GrM return candidates; } - candidates = getCandidates(GroovyResolveKind.CLASS); - if (!candidates.isEmpty()) { - return candidates; - } - candidates = getCandidates(GroovyResolveKind.PROPERTY); if (!candidates.isEmpty()) { return candidates; diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/ext/newify/NewifyResolveTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/ext/newify/NewifyResolveTest.groovy index d5a160a0e771..7efe9f412b29 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/ext/newify/NewifyResolveTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/ext/newify/NewifyResolveTest.groovy @@ -1,21 +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-2018 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.ext.newify -import com.intellij.psi.PsiClass import com.intellij.psi.PsiMethod import com.intellij.testFramework.LightProjectDescriptor import org.jetbrains.annotations.NotNull @@ -122,8 +107,7 @@ class B { @Newify def a (){ return Aa(name :"bar")} } -""", PsiClass - +""" } void checkResolve(@NotNull String text, @Nullable Class refType = null, @Nullable String returnType = null) { diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/ext/newify/NewifySupportTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/ext/newify/NewifySupportTest.groovy index e1039b67e1b4..febab34bdb4c 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/ext/newify/NewifySupportTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/ext/newify/NewifySupportTest.groovy @@ -1,18 +1,4 @@ -/* - * 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-2018 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.ext.newify import com.intellij.testFramework.LightProjectDescriptor @@ -179,7 +165,7 @@ class B { testHighlighting """ class B { @Newify - def a (){ return A()} + def a (){ return A()} } """ } diff --git a/plugins/groovy/testdata/groovy/completion/ClassNameBeforeParentheses_after.groovy b/plugins/groovy/testdata/groovy/completion/ClassNameBeforeParentheses_after.groovy index 5374dc066c5a..74fa5577054a 100644 --- a/plugins/groovy/testdata/groovy/completion/ClassNameBeforeParentheses_after.groovy +++ b/plugins/groovy/testdata/groovy/completion/ClassNameBeforeParentheses_after.groovy @@ -3,6 +3,6 @@ class BitImage { int width int getHeight() { - Math(data.length / width) + java.lang.Math(data.length / width) } } \ No newline at end of file