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


Java Divider类代码示例

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


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

示例1: inspectEx

import com.intellij.codeInsight.daemon.impl.Divider; //导入依赖的package包/类
@NotNull
public static Map<String, List<ProblemDescriptor>> inspectEx(@NotNull final List<LocalInspectionToolWrapper> toolWrappers,
                                                             @NotNull final PsiFile file,
                                                             @NotNull final InspectionManager iManager,
                                                             final boolean isOnTheFly,
                                                             boolean failFastOnAcquireReadAction,
                                                             @NotNull final ProgressIndicator indicator) {
  if (toolWrappers.isEmpty()) return Collections.emptyMap();
  final List<PsiElement> elements = new ArrayList<PsiElement>();

  TextRange range = file.getTextRange();
  Divider.divideInsideAndOutside(file, range.getStartOffset(), range.getEndOffset(), range, elements, new ArrayList<ProperTextRange>(),
                                 Collections.<PsiElement>emptyList(), Collections.<ProperTextRange>emptyList(), true, Conditions.<PsiFile>alwaysTrue());

  return inspectElements(toolWrappers, file, iManager, isOnTheFly, failFastOnAcquireReadAction, indicator, elements,
                         calcElementDialectIds(elements));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:InspectionEngine.java

示例2: inspectEx

import com.intellij.codeInsight.daemon.impl.Divider; //导入依赖的package包/类
@Nonnull
public static Map<String, List<ProblemDescriptor>> inspectEx(@Nonnull final List<LocalInspectionToolWrapper> toolWrappers,
                                                             @Nonnull final PsiFile file,
                                                             @Nonnull final InspectionManager iManager,
                                                             final boolean isOnTheFly,
                                                             boolean failFastOnAcquireReadAction,
                                                             @Nonnull final ProgressIndicator indicator) {
  if (toolWrappers.isEmpty()) return Collections.emptyMap();


  TextRange range = file.getTextRange();
  List<Divider.DividedElements> allDivided = new ArrayList<>();
  Divider.divideInsideAndOutsideAllRoots(file, range, range, Conditions.alwaysTrue(), new CommonProcessors.CollectProcessor<>(allDivided));

  List<PsiElement> elements = ContainerUtil.concat(
          (List<List<PsiElement>>)ContainerUtil.map(allDivided, d -> ContainerUtil.concat(d.inside, d.outside, d.parents)));

  return inspectElements(toolWrappers, file, iManager, isOnTheFly, failFastOnAcquireReadAction, indicator, elements,
                         calcElementDialectIds(elements));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:InspectionEngine.java

示例3: inspectEx

import com.intellij.codeInsight.daemon.impl.Divider; //导入依赖的package包/类
@NotNull
public static Map<String, List<ProblemDescriptor>> inspectEx(@NotNull final List<LocalInspectionTool> tools,
                                                             @NotNull final PsiFile file,
                                                             @NotNull final InspectionManager iManager,
                                                             final boolean isOnTheFly,
                                                             boolean failFastOnAcquireReadAction,
                                                             @NotNull final ProgressIndicator indicator) {
  if (tools.isEmpty()) return Collections.emptyMap();
  final Map<String, List<ProblemDescriptor>> resultDescriptors = new ConcurrentHashMap<String, List<ProblemDescriptor>>();
  final List<PsiElement> elements = new ArrayList<PsiElement>();

  TextRange range = file.getTextRange();
  final LocalInspectionToolSession session = new LocalInspectionToolSession(file, range.getStartOffset(), range.getEndOffset());
  Divider.divideInsideAndOutside(file, range.getStartOffset(), range.getEndOffset(), range, elements, new ArrayList<ProperTextRange>(),
                                 Collections.<PsiElement>emptyList(), Collections.<ProperTextRange>emptyList(), true, Condition.TRUE);

  boolean result = JobLauncher.getInstance().invokeConcurrentlyUnderProgress(tools, indicator, failFastOnAcquireReadAction,
                                                                             new Processor<LocalInspectionTool>() {
                                                                               @Override
                                                                               public boolean process(LocalInspectionTool tool) {
                                                                                 ProblemsHolder holder =
                                                                                   new ProblemsHolder(iManager, file, isOnTheFly);
                                                                                 createVisitorAndAcceptElements(tool, holder, isOnTheFly,
                                                                                                                session, elements, null);

                                                                                 tool.inspectionFinished(session, holder);

                                                                                 if (holder.hasResults()) {
                                                                                   resultDescriptors
                                                                                     .put(tool.getShortName(), holder.getResults());
                                                                                 }

                                                                                 return true;
                                                                               }
                                                                             });

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


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