void (@NotNull DocumentEvent e) { Document document = e.getDocument(); if (!shouldProcess(document)) { return; } handleBeforeDocumentChange(getUndoManager(null), document); ProjectManager projectManager = ProjectManager.getInstanceIfCreated(); if (projectManager != null) { for (Project project : projectManager.getOpenProjects()) { handleBeforeDocumentChange(getUndoManager(project), document); } } Project lightEditProject = LightEditUtil.getProjectIfCreated(); if (lightEditProject != null) { handleBeforeDocumentChange(getUndoManager(lightEditProject), document); } }