FormattingNotificationService (@NotNull Project project) { if (ApplicationManager.getApplication().isHeadlessEnvironment()) { return HeadlessNotificationService.INSTANCE; } else { return project.getService(FormattingNotificationService.class); } }