Package com.intellij.lang.javascript.psi

Examples of com.intellij.lang.javascript.psi.JSReferenceExpression


    });
  }

  public void testResolveTestCaseFunction() throws Exception {
    String fileText = "Test<ref>Case('', {});";
    JSReferenceExpression ref = (JSReferenceExpression)configureByFileText(fileText, "sample.js");
    final PsiElement resolved = doResolve(ref);
    assertTrue(resolved instanceof JSFunction);
  }
View Full Code Here


    JstdTestFileStructure testFileStructure = JstdTestFileStructureBuilder.getInstance().fetchCachedTestFileStructure(jsFile);
    for (JstdTestCaseStructure structure : testFileStructure.getTestCaseStructures()) {
      if (structure.getTestCount() == 0) {
        JSCallExpression callExpression = structure.getEnclosingCallExpression();
        if (callExpression.isValid()) {
          JSReferenceExpression methodExpression = ObjectUtils.tryCast(callExpression.getMethodExpression(), JSReferenceExpression.class);
          if (methodExpression != null) {
            int startOffset = methodExpression.getStartOffsetInParent();
            TextRange rangeInElement = TextRange.create(
              startOffset,
              startOffset + methodExpression.getTextLength()
            );
            holder.registerProblem(
              callExpression,
              "TestCase has no tests. Tests names should have 'test' prefix.",
              ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
View Full Code Here

          jsFile = ObjectUtils.tryCast(jsCallExpression.getContainingFile(), JSFile.class);
        }
        if (jsFile == null) {
          return;
        }
        JSReferenceExpression methodExpression = ObjectUtils.tryCast(jsCallExpression.getMethodExpression(), JSReferenceExpression.class);
        if (methodExpression == null) {
          return;
        }
        boolean suitableSymbol = isSuitableElement(jsFile, jsCallExpression);
        if (suitableSymbol) {
          boolean resolved = isResolved(methodExpression);
          if (!resolved) {
            TextRange rangeInElement = TextRange.create(0, methodExpression.getTextLength());
            HintWrapperQuickFix fix = new HintWrapperQuickFix(
              methodExpression,
              rangeInElement,
              getFix()
            );
View Full Code Here

    if (ref instanceof JSTextReference) {
      final PsiElement element = ref.getElement();
      final JSCallExpression call = PsiTreeUtil.getParentOfType(element, JSCallExpression.class);
      final JSExpression expression = call != null ? call.getMethodExpression() : null;
      if (expression instanceof JSReferenceExpression) {
        JSReferenceExpression callee = (JSReferenceExpression)expression;
        JSExpression qualifier = callee.getQualifier();

        if (qualifier != null && "directive".equals(callee.getReferencedName()) &&
            AngularIndexUtil.hasAngularJS(element.getProject())) {
          return element;
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.intellij.lang.javascript.psi.JSReferenceExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.