Examples of JSLiteralExpression


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

    JSElementVisitor visitor = new JSElementVisitor() {
      @Override
      public void visitJSProperty(JSProperty property) {
        String name = JsPsiUtils.getPropertyName(property);
        if (BASE_PATH_VAR_NAME.equals(name)) {
          JSLiteralExpression value = ObjectUtils.tryCast(property.getValue(), JSLiteralExpression.class);
          if (value != null && value.isQuotedLiteral()) {
            basePathRef.set(StringUtil.stripQuotesAroundValue(value.getText()));
          }
        }
      }

      @Override
View Full Code Here

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

  public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(STRING_LITERAL_INSIDE_KARMA_CONFIG_FILE, new PsiReferenceProvider() {
      @NotNull
      @Override
      public PsiReference[] getReferencesByElement(@NotNull final PsiElement psiElement, @NotNull ProcessingContext processingContext) {
        JSLiteralExpression literalExpression = ObjectUtils.tryCast(psiElement, JSLiteralExpression.class);
        if (literalExpression == null) {
          return PsiReference.EMPTY_ARRAY;
        }
        if (KarmaBasePathFinder.isBasePathStringLiteral(literalExpression)) {
          return new BasePathFileReferenceSet(literalExpression, this).getAllReferences();
View Full Code Here

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

  private static PsiElementPattern.Capture<JSLiteralExpression> literalInProperty(final String propertyName) {
    return PlatformPatterns.psiElement(JSLiteralExpression.class).and(new FilterPattern(new ElementFilter() {
      @Override
      public boolean isAcceptable(Object element, @Nullable PsiElement context) {
        if (element instanceof JSLiteralExpression) {
          final JSLiteralExpression literal = (JSLiteralExpression)element;
          if (literal.isQuotedLiteral()) {
            final PsiElement parent = literal.getParent();
            if (parent instanceof JSProperty && propertyName.equals(((JSProperty)parent).getName())) {
              return AngularIndexUtil.hasAngularJS(literal.getProject());
            }
          }
        }
        return false;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.