use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrNameValuePairStub in project intellij-community by JetBrains.
the class GrNameValuePairElementType method createStub.
@NotNull
@Override
public GrNameValuePairStub createStub(@NotNull GrAnnotationNameValuePair psi, StubElement parentStub) {
String name = psi.getName();
GrAnnotationMemberValue value = psi.getValue();
return new GrNameValuePairStub(parentStub, name, value == null ? null : value.getText());
}
use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrNameValuePairStub in project intellij-community by JetBrains.
the class GrAnnotationNameValuePairImpl method getName.
@Override
@Nullable
public String getName() {
GrNameValuePairStub stub = getStub();
if (stub != null) {
return stub.getName();
}
final PsiElement nameId = getNameIdentifierGroovy();
return nameId != null ? nameId.getText() : null;
}
use of org.jetbrains.plugins.groovy.lang.psi.stubs.GrNameValuePairStub in project intellij-community by JetBrains.
the class GrAnnotationNameValuePairImpl method getDetachedValue.
@Override
@Nullable
public PsiAnnotationMemberValue getDetachedValue() {
GrNameValuePairStub stub = getStub();
if (stub != null) {
String text = stub.getValue();
PsiAnnotationMemberValue result = SoftReference.dereference(myDetachedValue);
if (result == null) {
GrAnnotation annotation = GroovyPsiElementFactory.getInstance(getProject()).createAnnotationFromText("@F(" + text + ")", this);
((LightVirtualFile) annotation.getContainingFile().getViewProvider().getVirtualFile()).setWritable(false);
PsiAnnotationMemberValue value = annotation.findAttributeValue(null);
myDetachedValue = new SoftReference<>(result = value);
}
return result;
}
return getValue();
}
Aggregations