pull up 'isQualified()' method

This commit is contained in:
Max Medvedev
2013-09-20 17:35:30 +04:00
parent 4edd102a68
commit a712f87da8
6 changed files with 31 additions and 8 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2013 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.
@@ -16,7 +16,6 @@
package org.jetbrains.plugins.groovy.lang.psi;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiQualifiedReference;
import com.intellij.psi.PsiQualifiedReferenceElement;
import org.jetbrains.annotations.Nullable;
@@ -31,4 +30,6 @@ public interface GrQualifiedReference<Qualifier extends PsiElement> extends PsiQ
@Nullable
PsiElement getReferenceNameElement();
boolean isQualified();
}
@@ -32,8 +32,6 @@ public interface GrReferenceExpression extends GrExpression, GrReferenceElement<
@Nullable
GrExpression getQualifierExpression();
boolean isQualified();
@Nullable
IElementType getDotTokenType();
@@ -191,4 +191,7 @@ public abstract class GrReferenceElementImpl<Q extends PsiElement> extends Groov
return whiteSpaceAndComments;
}
public boolean isQualified() {
return getQualifier() != null;
}
}
@@ -857,10 +857,6 @@ public class GrReferenceExpressionImpl extends GrReferenceElementImpl<GrExpressi
return findExpressionChild(this);
}
public boolean isQualified() {
return getQualifierExpression() != null;
}
@Nullable
public PsiElement getDotToken() {
return findChildByType(TokenSets.DOTS);
@@ -1,3 +1,18 @@
/*
* Copyright 2000-2013 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.
*/
package org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions;
import com.intellij.lang.ASTNode;
@@ -47,6 +62,11 @@ public abstract class GrThisSuperReferenceExpressionBase extends GrExpressionImp
return getLastChild();
}
@Override
public boolean isQualified() {
return getQualifier() != null;
}
@Override
public PsiElement getElement() {
return this;
@@ -124,6 +124,11 @@ public class GrLightClassReferenceElement extends LightElement implements GrCode
return null;
}
@Override
public boolean isQualified() {
return false;
}
@Override
public void accept(GroovyElementVisitor visitor) {
//todo ???