本文整理汇总了Java中com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutside方法的典型用法代码示例。如果您正苦于以下问题:Java Divider.divideInsideAndOutside方法的具体用法?Java Divider.divideInsideAndOutside怎么用?Java Divider.divideInsideAndOutside使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.daemon.impl.Divider
的用法示例。
在下文中一共展示了Divider.divideInsideAndOutside方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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包/类
@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;
}