本文整理汇总了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));
}
示例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));
}
示例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;
}