Package com.intellij.coldFusion.model.files

Examples of com.intellij.coldFusion.model.files.CfmlFile


    return (CfmlFile)PsiFileFactory.getInstance(project).createFileFromText(fileName, CfmlLanguage.INSTANCE, text);
  }

  @NotNull
  public static CfmlReferenceExpression createReferenceExpression(final String text, final Project project) {
    final CfmlFile dummyFile = createDummyFile(project, "<cfset " + text + " = 0>");
    final PsiElement tag = dummyFile.getFirstChild();
    assert tag != null;
    final CfmlAssignmentExpression assignment = PsiTreeUtil.getChildOfType(tag, CfmlAssignmentExpression.class);
    assert assignment != null;
    final CfmlReferenceExpression expression = PsiTreeUtil.getChildOfType(assignment, CfmlReferenceExpression.class);
    assert expression != null;
View Full Code Here


    return identifier;
  }

  @NotNull
  public static PsiElement createConstantString(final String text, final Project project) {
    final CfmlFile dummyFile = createDummyFile(project, "<cffunction name=\"" + text + "\"></cffunction>");
    final PsiElement tag = dummyFile.getFirstChild();
    assert tag != null;
    final CfmlAttributeNameImpl namedAttribute = PsiTreeUtil.getChildOfType(tag, CfmlAttributeNameImpl.class);
    assert namedAttribute != null;
    final PsiElement element = namedAttribute.getValueElement();
    assert element != null;
View Full Code Here

  public PsiType getPsiType() {
    CfmlComponentConstructorCall childByClass = findChildByClass(CfmlComponentConstructorCall.class);
    if (childByClass != null) {
      CfmlComponentReference referenceExpression = childByClass.getReferenceExpression();
      if (referenceExpression != null) {
        CfmlFile containingFile = getContainingFile();
        if (containingFile != null) {
          return new CfmlComponentType(referenceExpression.getComponentQualifiedName(referenceExpression.getText()),
                                       containingFile,
                                       getProject());
        }
View Full Code Here

    return false;
  }

  @Nullable
  private CfmlComponent getComponentDefinition() {
    CfmlFile containingFile = getContainingFile();
    if (containingFile != null) {
      return containingFile.getComponentDefinition();
    }
    return null;
  }
View Full Code Here

        */
    // return new CfmlElementImpl(node);
  }

  public PsiFile createFile(FileViewProvider viewProvider) {
    return new CfmlFile(viewProvider, CfmlLanguage.INSTANCE);
  }
View Full Code Here

    if (!componentQualifiedName.contains(".")) {
      // resolve with directory scope
      // PsiFile containingFile = getContainingFile();
      // containingFile = containingFile == null ? null : containingFile.getOriginalFile();
      {
        CfmlFile cfmlConteiningFile = originalFile;
        PsiDirectory directory = cfmlConteiningFile.getParent();
        if (directory != null) {
          GlobalSearchScope searchScope = GlobalSearchScopes.directoryScope(directory, false);

          final Collection<CfmlComponent> components = CfmlIndex.getInstance(project).getComponentsByNameInScope(
            componentQualifiedName, searchScope);
View Full Code Here

      }
    }
    PsiFile containingFile = getContainingFile();
    containingFile = containingFile == null ? null : containingFile.getOriginalFile();
    if (containingFile != null && containingFile instanceof CfmlFile) {
      CfmlFile cfmlContainingFile = (CfmlFile)containingFile;
      if (directoryName.length() == 0) {
        PsiDirectory directory = cfmlContainingFile.getParent();
        if (directory != null) {
          addVariantsFromPath(variants, "", directory.getVirtualFile().getPresentableUrl());
        }
      }
      else {
        String dirPath = cfmlContainingFile.getParent().getVirtualFile().getPath() + "/" + directoryName.replaceAll("[./]+", "/");
        addVariantsFromPath(variants, directoryName, dirPath);
      }
    }

    final String finalDirectoryName = directoryName;
View Full Code Here

public class CfmlFoldingBuilder implements FoldingBuilder, DumbAware {
  @NotNull
  public FoldingDescriptor[] buildFoldRegions(@NotNull ASTNode node, @NotNull Document document) {
    final PsiElement element = node.getPsi();
    if (element instanceof CfmlFile) {
      final CfmlFile file = (CfmlFile)element;
      final PsiElement[] children = file.getChildren();
      Collection<FoldingDescriptor> result = new LinkedList<FoldingDescriptor>();
      for (PsiElement child : children) {
        if (child != null && (child instanceof CfmlCompositeElement ||
                              child instanceof PsiComment)) {
          List<FoldingDescriptor> descriptors = new ArrayList<FoldingDescriptor>();
View Full Code Here

    return false;
  }

  @Nullable
  private CfmlComponent getComponentDefinition() {
    CfmlFile containingFile = getContainingFile();
    if (containingFile != null) {
      return containingFile.getComponentDefinition();
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of com.intellij.coldFusion.model.files.CfmlFile

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.