use of com.intellij.codeInsight.daemon.impl.HighlightVisitor in project intellij-community by JetBrains.
the class PsiConcurrencyStressTest method readStep.
private void readStep(final Random random) {
PsiClass aClass = getPsiClass();
switch(random.nextInt(4)) {
case 0:
mark("v");
aClass.getContainingFile().accept(new PsiRecursiveElementVisitor() {
});
break;
case 1:
mark("m");
for (int offset = 0; offset < myFile.getTextLength(); offset++) {
myFile.findElementAt(offset);
}
break;
case 2:
mark("h");
aClass.accept(new PsiRecursiveElementVisitor() {
@Override
public void visitElement(final PsiElement element) {
super.visitElement(element);
final HighlightInfoHolder infoHolder = new HighlightInfoHolder(myFile);
for (HighlightVisitor visitor : Extensions.getExtensions(HighlightVisitor.EP_HIGHLIGHT_VISITOR, getProject())) {
// to avoid race for com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.myAnnotationHolder
HighlightVisitor v = visitor.clone();
v.analyze(myFile, true, infoHolder, () -> v.visit(element));
}
}
});
break;
case 3:
mark("u");
for (PsiMethod method : aClass.getMethods()) {
method.getName();
}
break;
}
}
Aggregations