Java 类com.intellij.lang.javascript.psi.JSCommaExpression 实例源码

项目:react-templates-plugin    文件:RTRepeatExpression.java   
public Collection<JSDefinitionExpression> getDefinitions() {
    final PsiElement firstChild = getFirstChild();
    if (firstChild instanceof JSDefinitionExpression) {
        return Collections.singletonList((JSDefinitionExpression) firstChild);
    }
    if (firstChild instanceof JSParenthesizedExpression) {
        final PsiElement commaExpression = PsiTreeUtil.findChildOfType(firstChild, JSCommaExpression.class);
        if (commaExpression != null) {
            return PsiTreeUtil.findChildrenOfType(commaExpression, JSDefinitionExpression.class);
        }
    }
    return Collections.emptyList();
}
项目:react-templates-plugin    文件:RTRepeatExpression.java   
public Collection<JSDefinitionExpression> getDefinitions() {
    final PsiElement firstChild = getFirstChild();
    if (firstChild instanceof JSDefinitionExpression) {
        return Collections.singletonList((JSDefinitionExpression) firstChild);
    }
    if (firstChild instanceof JSParenthesizedExpression) {
        final PsiElement commaExpression = PsiTreeUtil.findChildOfType(firstChild, JSCommaExpression.class);
        if (commaExpression != null) {
            return PsiTreeUtil.findChildrenOfType(commaExpression, JSDefinitionExpression.class);
        }
    }
    return Collections.emptyList();
}
项目:emberjs-plugin    文件:EmberJSRepeatExpression.java   
public Collection<JSDefinitionExpression> getDefinitions() {
    final PsiElement firstChild = getFirstChild();
    if (firstChild instanceof JSDefinitionExpression) {
        return Collections.singletonList((JSDefinitionExpression)firstChild);
    } else if (firstChild instanceof JSParenthesizedExpression) {
        final PsiElement commaExpression = PsiTreeUtil.findChildOfType(firstChild, JSCommaExpression.class);
        if (commaExpression != null) {
            return PsiTreeUtil.findChildrenOfType(commaExpression, JSDefinitionExpression.class);
        }
    }
    return Collections.emptyList();
}
项目:consulo-javascript    文件:CommaExpressionJSInspection.java   
@Override public void visitJSCommaExpression(JSCommaExpression node) {
    super.visitJSCommaExpression(node);
    if(node.getParent() instanceof JSCommaExpression)
    {
        return;
    }
    if(node.getParent() instanceof JSForStatement)
    {
        return;
    }
    registerError(node);
}