当前位置: 首页>>代码示例>>Java>>正文


Java PsiErrorElement.getContainingFile方法代码示例

本文整理汇总了Java中com.intellij.psi.PsiErrorElement.getContainingFile方法的典型用法代码示例。如果您正苦于以下问题:Java PsiErrorElement.getContainingFile方法的具体用法?Java PsiErrorElement.getContainingFile怎么用?Java PsiErrorElement.getContainingFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.psi.PsiErrorElement的用法示例。


在下文中一共展示了PsiErrorElement.getContainingFile方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldHighlightErrorElement

import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
@Override
public boolean shouldHighlightErrorElement(@NotNull final PsiErrorElement element) {
  final PsiFile psiFile = element.getContainingFile();
  if (psiFile == null || psiFile.getViewProvider().getBaseLanguage() != HTMLLanguage.INSTANCE
                          && HTMLLanguage.INSTANCE != element.getLanguage()) return true;

  final PsiElement[] children = element.getChildren();
  if (children.length > 0) {
    if (children[0] instanceof XmlToken && XmlTokenType.XML_END_TAG_START == ((XmlToken)children[0]).getTokenType()) {
      if (XmlErrorMessages.message("xml.parsing.closing.tag.matches.nothing").equals(element.getErrorDescription())) {
        return false;
      }
    }
  }

  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:HtmlClosingTagErrorFilter.java

示例2: shouldHighlightErrorElement

import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
public boolean shouldHighlightErrorElement(@NotNull final PsiErrorElement element) {
  final PsiFile psiFile = element.getContainingFile();
  if (psiFile == null || (psiFile.getViewProvider().getBaseLanguage() != HTMLLanguage.INSTANCE
                          && HTMLLanguage.INSTANCE != element.getLanguage())) return true;

  final PsiElement[] children = element.getChildren();
  if (children.length > 0) {
    if (children[0] instanceof XmlToken && XmlTokenType.XML_END_TAG_START == ((XmlToken)children[0]).getTokenType()) {
      if (XmlErrorMessages.message("xml.parsing.closing.tag.matches.nothing").equals(element.getErrorDescription())) {
        return false;
      }
    }
  }

  return true;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:HtmlClosingTagErrorFilter.java

示例3: shouldHighlightErrorElement

import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
@Override
public boolean shouldHighlightErrorElement(@NotNull PsiErrorElement error) {
    final Project project = error.getProject();
    final Language language = error.getLanguage();
    if ("CSS".equals(language.getID()) && PsiTreeUtil.getParentOfType(error, XmlAttribute.class) != null &&
            EmberIndexUtil.hasEmberJS(project)) {
        final PsiFile file = error.getContainingFile();

        PsiErrorElement nextError = error;
        while (nextError != null) {
            nextError = PsiTreeUtil.getNextSiblingOfType(nextError, PsiErrorElement.class);
        }
    }
    if (HTMLLanguage.INSTANCE.is(language) && error.getErrorDescription().endsWith("not closed")) {
        final PsiElement parent = error.getParent();
        final XmlElementDescriptor descriptor = parent instanceof XmlTag ? ((XmlTag)parent).getDescriptor() : null;
        return !(descriptor instanceof EmberJSTagDescriptor);
    }
    return true;
}
 
开发者ID:kristianmandrup,项目名称:emberjs-plugin,代码行数:21,代码来源:EmberJSErrorFilter.java

示例4: shouldHighlightErrorElement

import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
@Override
public boolean shouldHighlightErrorElement(@NotNull PsiErrorElement element) {
  PsiFile file = element.getContainingFile();
  if (file == null) {
    return true;
  }
  VirtualFile virtualFile = file.getVirtualFile();
  if (virtualFile == null) {
    return true;
  }
  TaskFile taskFile = StudyUtils.getTaskFile(element.getProject(), virtualFile);
  return taskFile == null || taskFile.isHighlightErrors();
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:14,代码来源:StudyHighlightErrorFilter.java

示例5: shouldHighlightErrorElement

import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
@Override
public boolean shouldHighlightErrorElement(@NotNull PsiErrorElement element) {
  PsiFile file = element.getContainingFile();
  if (file == null) {
    return true;
  }
  VirtualFile virtualFile = file.getVirtualFile();
  if (virtualFile == null) {
    return true;
  }
  if (virtualFile.getPath().contains(CCUtils.GENERATED_FILES_FOLDER)) {
    return false;
  }
  return true;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:16,代码来源:CCHighlightErrorFilter.java

示例6: registerErrorQuickFix

import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
@Override
public void registerErrorQuickFix(@NotNull final PsiErrorElement errorElement, @NotNull final HighlightInfo highlightInfo) {
  final PsiFile psiFile = errorElement.getContainingFile();
  final FileViewProvider provider = psiFile.getViewProvider();
  if (!(provider instanceof TemplateLanguageFileViewProvider)) return;
  if (psiFile.getLanguage() != ((TemplateLanguageFileViewProvider) provider).getTemplateDataLanguage()) return;

  QuickFixAction.registerQuickFixAction(highlightInfo, createChangeTemplateDataLanguageFix(errorElement));

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:TemplateLanguageErrorQuickFixProvider.java

示例7: shouldHighlightErrorElement

import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
@Override
public boolean shouldHighlightErrorElement(@NotNull PsiErrorElement element) {
    final PsiFile file = element.getContainingFile();
    if(file instanceof JsonFile) {
        if(Boolean.TRUE.equals(file.getVirtualFile().getUserData(JSGraphQLLanguageUIProjectService.IS_GRAPH_QL_VARIABLES_VIRTUAL_FILE))) {
            // this is the variables file for GraphQL, so ignore errors as long as it's empty
            return !file.getText().isEmpty();
        }
    }
    return true;
}
 
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:12,代码来源:JSGraphQLVariablesHighlightErrorFilter.java

示例8: registerErrorQuickFix

import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
@Override
public void registerErrorQuickFix(final PsiErrorElement errorElement, final HighlightInfo highlightInfo) {
  final PsiFile psiFile = errorElement.getContainingFile();
  final FileViewProvider provider = psiFile.getViewProvider();
  if (!(provider instanceof TemplateLanguageFileViewProvider)) return;
  if (psiFile.getLanguage() != ((TemplateLanguageFileViewProvider) provider).getTemplateDataLanguage()) return;

  QuickFixAction.registerQuickFixAction(highlightInfo, createChangeTemplateDataLanguageFix(errorElement));

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:TemplateLanguageErrorQuickFixProvider.java

示例9: shouldHighlightErrorElement

import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
public boolean shouldHighlightErrorElement(@NotNull final PsiErrorElement element) {
  final PsiFile file = element.getContainingFile();
  return !(file instanceof PyDocstringFile);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:PyDocstringErrorFilter.java

示例10: value

import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
public static boolean value(final PsiErrorElement psiErrorElement) {
  final PsiFile file = psiErrorElement.getContainingFile();
  return file.getViewProvider() instanceof VtlFileViewProvider && !(file instanceof VtlFile);
}
 
开发者ID:consulo,项目名称:consulo-apache-velocity,代码行数:5,代码来源:VtlErrorFilter.java


注:本文中的com.intellij.psi.PsiErrorElement.getContainingFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。