本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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));
}
示例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));
}
示例9: shouldHighlightErrorElement
import com.intellij.psi.PsiErrorElement; //导入方法依赖的package包/类
public boolean shouldHighlightErrorElement(@NotNull final PsiErrorElement element) {
final PsiFile file = element.getContainingFile();
return !(file instanceof PyDocstringFile);
}
示例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);
}