void (VirtualFile moduleFile, final String fileName) { myFixture.doHighlighting(); complete(); assertStringItems("\"one\"", "\"two\""); final VirtualFile baseFile = moduleFile.findChild(fileName); Assert.assertNotNull(baseFile); FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance(); Document document = fileDocumentManager.getDocument(baseFile); Assert.assertNotNull(document); String str = "\"enum\": [\"one\", \"two\"]"; int start = document.getText().indexOf(str); Assert.assertTrue(start > 0); CommandProcessor.getInstance().runUndoTransparentAction(() -> ApplicationManager.getApplication().runWriteAction(() -> { document.replaceString(start, start + str.length(), "\"enum\": [\"one1\", \"two1\"]"); fileDocumentManager.saveAllDocuments(); })); JsonSchemaService.Impl.get(getProject()).reset(); myFixture.doHighlighting(); complete(); assertStringItems("\"one1\"", "\"two1\""); JsonSchemaService.Impl.get(getProject()).reset(); myFixture.doHighlighting(); complete(); assertStringItems("\"one1\"", "\"two1\""); }