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

项目:ReactPropTypes-Plugin    文件:CommonAction.java   
@NotNull
private List<PropTypeBean>  findPropsNameListWithIdentityReference(String identity, PsiElement psiElement){
  return PsiTreeUtil.findChildrenOfType(psiElement, LeafPsiElement.class)
          .stream()
          .filter(o -> o.getText().equals(identity))
          .filter(o -> o.getElementType().toString().equals("JS:IDENTIFIER"))
          .filter(o -> {
            if(o.getParent() instanceof JSReferenceExpressionImpl){
              JSReferenceExpressionImpl parent = (JSReferenceExpressionImpl) o.getParent();
              if(parent.getTreeNext()!=null && parent.getTreeNext().getElementType().toString().equals("JS:DOT")
                      &&parent.getTreeNext().getTreeNext()!=null){
                return true;
              }
            }
            return  false;
          })
          .map(o -> ((JSReferenceExpressionImpl)o.getParent()).getTreeNext().getTreeNext().getText())
          .distinct()
          .map(o -> new PropTypeBean(o,"any", false))
          .collect(Collectors.toList());
}
项目:emberjs-plugin    文件:EmberJSCompletionContributor.java   
@Override
public void fillCompletionVariants(@NotNull final CompletionParameters parameters, @NotNull final CompletionResultSet result) {
    if (!getElementLanguage(parameters).is(EmberJSLanguage.INSTANCE)) return;
    PsiReference ref = parameters.getPosition().getContainingFile().findReferenceAt(parameters.getOffset());

    if (ref instanceof JSReferenceExpressionImpl && ((JSReferenceExpressionImpl)ref).getQualifier() == null) {
        final PsiElement parent = ((JSReferenceExpressionImpl)ref).getParent();

        // if (addControllerVariants(result, ref, parent)) return;

        EmberJSProcessor.process(parameters.getPosition(), new Consumer<JSNamedElement>() {
            @Override
            public void consume(JSNamedElement element) {
                result.consume(JSLookupUtilImpl.createPrioritizedLookupItem(element, element.getName(), EMBER_VARIABLE_PRIORITY, false, false));
            }
        });
    }
}
项目:consulo-javascript    文件:JSResolveUtil.java   
public static
@Nullable
JSExpression getRealRefExprQualifier(final JSReferenceExpression expr)
{
    final JSExpression qualifier = ((JSReferenceExpressionImpl) expr).getResolveQualifier();
    if(qualifier != null)
    {
        return qualifier;
    }

    if(isExprInTypeContext(expr))
    {
        final JSImportedElementResolveResult resolved = JSImportHandlingUtil.resolveTypeNameUsingImports(expr);
        if(resolved == null)
        {
            return expr.getQualifier();
        }

        return getRealRefExprQualifierFromResult(expr, resolved);
    }

    return qualifier;
}
项目:emberjs-plugin    文件:EmberJSReferenceExpressionResolver.java   
public EmberJSReferenceExpressionResolver(JSReferenceExpressionImpl expression, PsiFile file) {
    super(expression, file);
}
项目:emberjs-plugin    文件:EmberJSSpecificHandlersFactory.java   
@NotNull
@Override
public JSResolveUtil.Resolver<JSReferenceExpressionImpl> createReferenceExpressionResolver(JSReferenceExpressionImpl referenceExpression,
                                                                                           PsiFile containingFile) {
    return new EmberJSReferenceExpressionResolver(referenceExpression, containingFile);
}