Package com.intellij.psi.impl.source

Examples of com.intellij.psi.impl.source.PsiFileImpl


    if (parserDefinition == null) {
      return null;
    }

    if (lang == getTemplateDataLanguage()) {
      PsiFileImpl file = (PsiFileImpl)parserDefinition.createFile(this);
      file.setContentElementType(TEMPLATE_DATA_ELEMENT_TYPE);
      return file;
    }
    else if (lang == HbLanguage.INSTANCE) {
      return parserDefinition.createFile(this);
    }
View Full Code Here


    @Override
    protected PsiFile createFile(Language lang) {
        // creating file for main lang (HTML)
        if(lang == myTemplateDataLanguage) {
            PsiFileImpl file = (PsiFileImpl) LanguageParserDefinitions.INSTANCE.forLanguage(lang).createFile(this);
            file.setContentElementType(LatteTokenTypes.TEMPLATE_DATA);
            return file;
        } else if(lang == LatteLanguage.LATTE_LANGUAGE) {
            return LanguageParserDefinitions.INSTANCE.forLanguage(lang).createFile(this);
        } else {
            return null;
View Full Code Here

    if (parserDefinition == null) {
      return null;
    }

    if (lang.is(getTemplateDataLanguage())) {
      PsiFileImpl file = (PsiFileImpl)parserDefinition.createFile(this);
      file.setContentElementType(getTemplateDataElementType(getBaseLanguage()));
      return file;
    }
    else if (lang.isKindOf(getBaseLanguage())) {
      return parserDefinition.createFile(this);
    }
View Full Code Here

  @Nullable
  protected PsiFile createFile(@NotNull final Language lang) {
    if (lang == getTemplateDataLanguage()) {
      // final PsiFileImpl file = (PsiFileImpl)LanguageParserDefinitions.INSTANCE.forLanguage(lang).createFile(this);

      final PsiFileImpl file = (PsiFileImpl)LanguageParserDefinitions.INSTANCE.forLanguage(StdLanguages.HTML).createFile(this);
      file.setContentElementType(CfmlElementTypes.TEMPLATE_DATA);
      return file;
    }
    if (lang == SqlLanguage.INSTANCE) {
      final PsiFileImpl file = (PsiFileImpl)LanguageParserDefinitions.INSTANCE.forLanguage(SqlLanguage.INSTANCE).createFile(this);
      file.setContentElementType(CfmlElementTypes.SQL_DATA);
      return file;
    }

    if (lang == getBaseLanguage()) {
      return LanguageParserDefinitions.INSTANCE.forLanguage(lang).createFile(this);
View Full Code Here

* @author peter
*/
public class StubTest extends LightCodeInsightFixtureTestCase {

  public void testDontParseUnrelatedNamespacesDuringResolve() {
    PsiFileImpl ns1 = (PsiFileImpl) myFixture.addFileToProject("ns1.clj", "(ns ns1)");
    PsiFileImpl ns2 = (PsiFileImpl) myFixture.addFileToProject("ns2.clj", "(ns ns2)");
    myFixture.configureByText("ns3.clj", "(require ns2)\n(ns2/foo)");

    myFixture.doHighlighting();
    assert !ns1.isContentsLoaded();
  }
View Full Code Here

    myFixture.doHighlighting();
    assert !ns1.isContentsLoaded();
  }

  public void testDontParseTargetFileDuringDefnResolve() {
    PsiFileImpl used = (PsiFileImpl) myFixture.addFileToProject("used.clj", "(ns used)\n(defn foo [] (println \"hello\"))");
    myFixture.configureByText("main.clj", "(require used)\n(used/f<caret>oo)");

    PsiReference ref = myFixture.getFile().findReferenceAt(myFixture.getEditor().getCaretModel().getOffset());
    assertNotNull(ref);
    assertInstanceOf(ref.resolve(), ClDef.class);
    assert !used.isContentsLoaded();
  }
View Full Code Here

TOP

Related Classes of com.intellij.psi.impl.source.PsiFileImpl

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.