Search in sources :

Example 1 with PsiNameValuePairStubImpl

use of com.intellij.psi.impl.java.stubs.impl.PsiNameValuePairStubImpl in project intellij-community by JetBrains.

the class JavaNameValuePairType method createStub.

@Override
public PsiNameValuePairStub createStub(LighterAST tree, LighterASTNode node, StubElement parentStub) {
    String name = null;
    String value = null;
    List<LighterASTNode> children = tree.getChildren(node);
    for (LighterASTNode child : children) {
        if (child.getTokenType() == JavaTokenType.IDENTIFIER) {
            name = RecordUtil.intern(tree.getCharTable(), child);
        } else if (ElementType.ANNOTATION_MEMBER_VALUE_BIT_SET.contains(child.getTokenType())) {
            value = LightTreeUtil.toFilteredString(tree, child, null);
        }
    }
    return new PsiNameValuePairStubImpl(parentStub, name, value);
}
Also used : LighterASTNode(com.intellij.lang.LighterASTNode) PsiNameValuePairStubImpl(com.intellij.psi.impl.java.stubs.impl.PsiNameValuePairStubImpl)

Aggregations

LighterASTNode (com.intellij.lang.LighterASTNode)1 PsiNameValuePairStubImpl (com.intellij.psi.impl.java.stubs.impl.PsiNameValuePairStubImpl)1