void (@NotNull PsiElement element) { if (element instanceof PsiComment) { myHolder.add(HighlightInfo.newHighlightInfo(HighlightInfoType.WARNING).range(element.getTextRange().cutOut(TextRange.create(0, 1))).description("MY: XXX").create()); // immediately after creation ApplicationManager.getApplication().invokeLater(()->xxxMustBeVisible.set(true)); TimeoutUtil.sleep(10_000); myHolder.add(HighlightInfo.newHighlightInfo(HighlightInfoType.WARNING).range(element.getTextRange().cutOut(TextRange.create(1, 2))).description("MY: XXX2").create()); } }