void () { class Fac implements TextEditorHighlightingPassFactory { @Override public TextEditorHighlightingPass createHighlightingPass(@NotNull PsiFile file, @NotNull Editor editor) { return null; } } TextEditorHighlightingPassRegistrar registrar = TextEditorHighlightingPassRegistrar.getInstance(getProject()); registrar.registerTextEditorHighlightingPass(new Fac(), null, null, false, -1); configureByText(JavaFileType.INSTANCE, "@Deprecated<caret> class S { } "); List<HighlightInfo> infos = doHighlighting(HighlightInfoType.SYMBOL_TYPE_SEVERITY); assertEquals(2, infos.size()); assertEquals("@Deprecated", infos.get(0).getText()); assertEquals("S", infos.get(1).getText()); backspace(); type('d'); List<HighlightInfo> after = doHighlighting(HighlightInfoType.SYMBOL_TYPE_SEVERITY); assertEquals("@Deprecated", after.get(0).getText()); assertEquals("S", after.get(1).getText()); backspace(); type('d'); getEditor().getCaretModel().moveToOffset(getEditor().getDocument().getTextLength()); type(" "); after = doHighlighting(HighlightInfoType.SYMBOL_TYPE_SEVERITY); assertEquals(2, after.size()); assertEquals("@Deprecated", after.get(0).getText()); assertEquals("S", after.get(1).getText()); }