void () { doTest(true); WriteCommandAction.runWriteCommandAction(null, () -> { PsiDirectory directory = getFile().getParent(); assertNotNull(getFile().toString(), directory); PsiFile txt = directory.createFile("x.txt"); VirtualFile vFile = txt.getVirtualFile(); assertNotNull(txt.toString(), vFile); try { VfsUtil.saveText(vFile, "XXX"); } catch (IOException e) { throw new RuntimeException(e); } }); List<HighlightInfo> infos = doHighlighting(HighlightSeverity.WARNING); assertEmpty(infos); }