void (VirtualFile... files) { // ensure the validation/conversion runs on the current content final FileDocumentManager mgr = FileDocumentManager.getInstance(); for (VirtualFile f : files) { final Document document = mgr.getDocument(f); if (document != null) { mgr.saveDocument(document); } } }