void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) return; ScratchImplUtil.TextExtractor extractor = ScratchImplUtil.getTextExtractor(e.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT)); String text = extractor == null ? null : extractor.extractText(); if (text == null) return; ScratchFileCreationHelper.Context context = new ScratchFileCreationHelper.Context(); context.text = text; context.fileExtension = PlainTextFileType.INSTANCE.getDefaultExtension(); doCreateNewScratch(project, context); }