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


Java MultiplePsiFilesPerDocumentFileViewProvider类代码示例

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


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

示例1: findSupport

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@RequiredReadAction
private RangeMarker findSupport(RangeMarker leader, PsiFile file, Document document)
{
	final int offset = leader.getStartOffset();
	PsiElement element = InjectedLanguageUtil.findElementAtNoCommit(file, offset);
	PsiElement support = findSupportElement(element);
	if(support == null && file.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider)
	{
		element = file.getViewProvider().findElementAt(offset, myLanguage);
		support = findSupportElement(element);
	}

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

	final TextRange range = support.getTextRange();
	TextRange realRange = InjectedLanguageManager.getInstance(file.getProject()).injectedToHost(element.getContainingFile(), range);
	return document.createRangeMarker(realRange.getStartOffset(), realRange.getEndOffset(), true);
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:22,代码来源:XmlTagNameSynchronizer.java

示例2: collectInformation

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Nullable
    private static ExternalLintAnnotationInput collectInformation(@NotNull PsiFile psiFile, @Nullable Editor editor) {
        if (psiFile.getContext() != null || !SassLintConfigFileUtil.isSassFile(psiFile)) {
            return null;
        }
        VirtualFile virtualFile = psiFile.getVirtualFile();
        if (virtualFile == null || !virtualFile.isInLocalFileSystem()) {
            return null;
        }
        if (psiFile.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
            return null;
        }
        Project project = psiFile.getProject();
        SassLintProjectComponent component = project.getComponent(SassLintProjectComponent.class);
        if (!component.isSettingsValid() || !component.isEnabled()) {
            return null;
        }
        Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
        if (document == null) {
            return null;
        }
        String fileContent = document.getText();
        if (StringUtil.isEmptyOrSpaces(fileContent)) {
            return null;
        }
        EditorColorsScheme colorsScheme = editor != null ? editor.getColorsScheme() : null;
//        tabSize = getTabSize(editor);
//        tabSize = 4;
        return new ExternalLintAnnotationInput(project, psiFile, fileContent, colorsScheme);
    }
 
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:31,代码来源:SassLintExternalAnnotator.java

示例3: isSupported

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
public boolean isSupported(@NotNull Class visitorClass, @NotNull PsiFile file) {
  if (visitorClass == StringLiteralQuotesAnnotator.class &&
      file.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
    return false;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PyMultiplePsiFilesVisitorFilter.java

示例4: checkValue

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected void checkValue(XmlAttributeValue value, XmlFile file, XmlRefCountHolder refHolder, XmlTag tag, ProblemsHolder holder) {

  String idRef = XmlHighlightVisitor.getUnquotedValue(value, tag);

  if (tag instanceof HtmlTag) {
    idRef = idRef.toLowerCase();
  }

  if (XmlUtil.isSimpleValue(idRef, value) && refHolder.isIdReferenceValue(value)) {
    boolean hasIdDeclaration = refHolder.hasIdDeclaration(idRef);
    if (!hasIdDeclaration && tag instanceof HtmlTag) {
      hasIdDeclaration = refHolder.hasIdDeclaration(value.getValue());
    }

    if (!hasIdDeclaration) {
      for(XmlIdContributor contributor: Extensions.getExtensions(XmlIdContributor.EP_NAME)) {
        if (contributor.suppressExistingIdValidation(file)) {
          return;
        }
      }

      final FileViewProvider viewProvider = tag.getContainingFile().getViewProvider();
      if (viewProvider instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
        holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL,
                               new XmlDeclareIdInCommentAction(idRef));

      }
      else {
        holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:XmlInvalidIdInspection.java

示例5: collectInformation

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Nullable
    private static ExternalLintAnnotationInput collectInformation(@NotNull PsiFile psiFile, @Nullable Editor editor) {
        if (psiFile.getContext() != null || !RTFileUtil.isRTFile(psiFile)) {
            return null;
        }
        VirtualFile virtualFile = psiFile.getVirtualFile();
        if (virtualFile == null || !virtualFile.isInLocalFileSystem()) {
            return null;
        }
        if (psiFile.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
            return null;
        }
        Project project = psiFile.getProject();
        RTProjectComponent component = project.getComponent(RTProjectComponent.class);
        if (component == null || !component.isValidAndEnabled()) {
            return null;
        }
        Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
        if (document == null) {
            return null;
        }
        String fileContent = document.getText();
        if (StringUtil.isEmptyOrSpaces(fileContent)) {
            return null;
        }
        EditorColorsScheme colorsScheme = editor == null ? null : editor.getColorsScheme();
//        tabSize = getTabSize(editor);
//        tabSize = 4;
        return new ExternalLintAnnotationInput(project, psiFile, fileContent, colorsScheme);
    }
 
开发者ID:idok,项目名称:react-templates-plugin,代码行数:31,代码来源:RTExternalAnnotator.java

示例6: collectInformation

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Nullable
    private static ExternalLintAnnotationInput collectInformation(@NotNull PsiFile psiFile, @Nullable Editor editor) {
        if (psiFile.getContext() != null || !CoffeeLintConfigFileUtil.isCoffeeScriptFile(psiFile)) {
            return null;
        }
        VirtualFile virtualFile = psiFile.getVirtualFile();
        if (virtualFile == null || !virtualFile.isInLocalFileSystem()) {
            return null;
        }
        if (psiFile.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
            return null;
        }
        Project project = psiFile.getProject();
        CoffeeLintProjectComponent component = project.getComponent(CoffeeLintProjectComponent.class);
        if (!component.isSettingsValid() || !component.isEnabled()) {
            return null;
        }
        Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
        if (document == null) {
            return null;
        }
        String fileContent = document.getText();
        if (StringUtil.isEmptyOrSpaces(fileContent)) {
            return null;
        }
        EditorColorsScheme colorsScheme = editor != null ? editor.getColorsScheme() : null;
//        tabSize = getTabSize(editor);
//        tabSize = 4;
        return new ExternalLintAnnotationInput(project, psiFile, fileContent, colorsScheme);
    }
 
开发者ID:idok,项目名称:coffee-lint-plugin,代码行数:31,代码来源:CoffeeLintExternalAnnotator.java

示例7: collectInformation

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Nullable
    private static ExternalLintAnnotationInput collectInformation(@NotNull PsiFile psiFile, @Nullable Editor editor) {
        if (psiFile.getContext() != null) {
            return null;
        }
        VirtualFile virtualFile = psiFile.getVirtualFile();
        if (virtualFile == null || !virtualFile.isInLocalFileSystem()) {
            return null;
        }
        if (psiFile.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
            return null;
        }
        Project project = psiFile.getProject();
        ESLintProjectComponent component = project.getComponent(ESLintProjectComponent.class);
        if (!component.isSettingsValid() || !component.isEnabled() || !isJavaScriptFile(psiFile, component.ext)) {
            return null;
        }
        Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
        if (document == null) {
            return null;
        }
        String fileContent = document.getText();
        if (StringUtil.isEmptyOrSpaces(fileContent)) {
            return null;
        }
        EditorColorsScheme colorsScheme = editor == null ? null : editor.getColorsScheme();
//        tabSize = getTabSize(editor);
//        tabSize = 4;
        return new ExternalLintAnnotationInput(project, psiFile, fileContent, colorsScheme);
    }
 
开发者ID:idok,项目名称:eslint-plugin,代码行数:31,代码来源:ESLintExternalAnnotator.java

示例8: checkValue

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
protected void checkValue(XmlAttributeValue value, XmlFile file, XmlRefCountHolder refHolder, XmlTag tag, ProblemsHolder holder) {

    String idRef = XmlHighlightVisitor.getUnquotedValue(value, tag);

    if (tag instanceof HtmlTag) {
      idRef = idRef.toLowerCase();
    }

    if (XmlUtil.isSimpleXmlAttributeValue(idRef, value) && refHolder.isIdReferenceValue(value)) {
      boolean hasIdDeclaration = refHolder.hasIdDeclaration(idRef);
      if (!hasIdDeclaration && tag instanceof HtmlTag) {
        hasIdDeclaration = refHolder.hasIdDeclaration(value.getValue());
      }

      if (!hasIdDeclaration) {
        for(XmlIdContributor contributor: Extensions.getExtensions(XmlIdContributor.EP_NAME)) {
          if (contributor.suppressExistingIdValidation(file)) {
            return;
          }
        }

        final FileViewProvider viewProvider = tag.getContainingFile().getViewProvider();
        if (viewProvider instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
          holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL,
                                 new XmlDeclareIdInCommentAction(idRef));

        }
        else {
          holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
        }
      }
    }
  }
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:34,代码来源:XmlInvalidIdInspection.java

示例9: checkValue

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
protected void checkValue(XmlAttributeValue value, XmlFile file, XmlRefCountHolder refHolder, XmlTag tag, ProblemsHolder holder) {

    String idRef = XmlHighlightVisitor.getUnquotedValue(value, tag);

    if (tag instanceof HtmlTag) {
      idRef = idRef.toLowerCase();
    }

    if (XmlUtil.isSimpleValue(idRef, value) && refHolder.isIdReferenceValue(value)) {
      boolean hasIdDeclaration = refHolder.hasIdDeclaration(idRef);
      if (!hasIdDeclaration && tag instanceof HtmlTag) {
        hasIdDeclaration = refHolder.hasIdDeclaration(value.getValue());
      }

      if (!hasIdDeclaration) {
        for(XmlIdContributor contributor: Extensions.getExtensions(XmlIdContributor.EP_NAME)) {
          if (contributor.suppressExistingIdValidation(file)) {
            return;
          }
        }

        final FileViewProvider viewProvider = tag.getContainingFile().getViewProvider();
        if (viewProvider instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
          holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL,
                                 new XmlDeclareIdInCommentAction(idRef));

        }
        else {
          holder.registerProblem(value, XmlErrorMessages.message("invalid.id.reference"), ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
        }
      }
    }
  }
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:34,代码来源:XmlInvalidIdInspection.java

示例10: cloneInner

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile virtualFile) {
  return new SoyFileViewProvider(getManager(), virtualFile, false);
}
 
开发者ID:google,项目名称:bamboo-soy,代码行数:5,代码来源:SoyFileViewProvider.java

示例11: cloneInner

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile virtualFile) {
    return new RythmFileViewProvider(getManager(), virtualFile, false, myBaseLanguage, myTemplateLanguage);
}
 
开发者ID:scireum-incubator,项目名称:rythm_plugin,代码行数:5,代码来源:RythmFileViewProvider.java

示例12: cloneInner

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile file) {
    return new JetFileViewProvider(getManager(), file, false, myTemplateDataLanguage);
}
 
开发者ID:jhsx,项目名称:GoJetPlugin,代码行数:5,代码来源:JetFileViewProvider.java

示例13: cloneInner

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile virtualFile) {
  return new RestFileViewProvider(getManager(), virtualFile, false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:RestFileViewProvider.java

示例14: cloneInner

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile fileCopy) {
	return new LatteFileViewProvider(getManager(), fileCopy, false);
}
 
开发者ID:JanTvrdik,项目名称:intellij-latte,代码行数:5,代码来源:LatteFileViewProvider.java

示例15: cloneInner

import com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider; //导入依赖的package包/类
@Override
protected MultiplePsiFilesPerDocumentFileViewProvider cloneInner(VirtualFile virtualFile) {
    return new DotFileViewProvider(getManager(), virtualFile, false);
}
 
开发者ID:webschik,项目名称:idea-doT,代码行数:5,代码来源:DotFileViewProvider.java


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