mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] push #getTextSkipWhiteSpaceAndComments() down to GrCodeReferenceElementImpl
This commit is contained in:
-10
@@ -22,7 +22,6 @@ public abstract class GrReferenceElementImpl<Q extends PsiElement> extends Groov
|
||||
private static final String DUMMY_FQN = "05ab655a-0e15-4f35-909d-9dff5e757f63";
|
||||
|
||||
private volatile String myQualifiedReferenceName = DUMMY_FQN;
|
||||
private volatile String myCachedTextSkipWhiteSpaceAndComments;
|
||||
|
||||
public GrReferenceElementImpl(@NotNull ASTNode node) {
|
||||
super(node);
|
||||
@@ -31,7 +30,6 @@ public abstract class GrReferenceElementImpl<Q extends PsiElement> extends Groov
|
||||
@Override
|
||||
public void subtreeChanged() {
|
||||
myQualifiedReferenceName = DUMMY_FQN;
|
||||
myCachedTextSkipWhiteSpaceAndComments = null;
|
||||
super.subtreeChanged();
|
||||
}
|
||||
|
||||
@@ -175,14 +173,6 @@ public abstract class GrReferenceElementImpl<Q extends PsiElement> extends Groov
|
||||
PsiImplUtil.setQualifier(this, newQualifier);
|
||||
}
|
||||
|
||||
public String getTextSkipWhiteSpaceAndComments() {
|
||||
String whiteSpaceAndComments = myCachedTextSkipWhiteSpaceAndComments;
|
||||
if (whiteSpaceAndComments == null) {
|
||||
myCachedTextSkipWhiteSpaceAndComments = whiteSpaceAndComments = PsiImplUtil.getTextSkipWhiteSpaceAndComments(getNode());
|
||||
}
|
||||
return whiteSpaceAndComments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isQualified() {
|
||||
return getQualifier() != null;
|
||||
|
||||
+16
@@ -39,6 +39,22 @@ public class GrCodeReferenceElementImpl extends GrReferenceElementImpl<GrCodeRef
|
||||
super(node);
|
||||
}
|
||||
|
||||
private volatile String myCachedTextSkipWhiteSpaceAndComments;
|
||||
|
||||
@Override
|
||||
public void subtreeChanged() {
|
||||
myCachedTextSkipWhiteSpaceAndComments = null;
|
||||
super.subtreeChanged();
|
||||
}
|
||||
|
||||
private String getTextSkipWhiteSpaceAndComments() {
|
||||
String whiteSpaceAndComments = myCachedTextSkipWhiteSpaceAndComments;
|
||||
if (whiteSpaceAndComments == null) {
|
||||
myCachedTextSkipWhiteSpaceAndComments = whiteSpaceAndComments = PsiImplUtil.getTextSkipWhiteSpaceAndComments(getNode());
|
||||
}
|
||||
return whiteSpaceAndComments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiReference getReference() {
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user