void (@NotNull AnActionEvent e) { Project project = e.getProject(); Editor editor = e.getData(CommonDataKeys.EDITOR); VirtualFile virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE); if (project == null || editor == null || virtualFile == null) return; String extension = virtualFile.getExtension(); IdeScriptEngineManager.EngineInfo engineInfo0 = virtualFile.getUserData(SELECTED_ENGINE_INFO_KEY); if (engineInfo == null && engineInfo0 == null && extension == null) return; PsiDocumentManager.getInstance(project).commitAllDocuments(); if (engineInfo == null || engineInfo0 != null && !Comparing.equal(engineInfo0, engineInfo) || extension != null && !engineInfo.fileExtensions.contains(extension)) { virtualFile.putUserData(SELECTED_ENGINE_INFO_KEY, null); List<IdeScriptEngineManager.EngineInfo> infos = engineInfo0 != null ? Collections.singletonList(engineInfo0) : JBIterable.from(IdeScriptEngineManager.getInstance().getEngineInfos()) .filter(o -> o.fileExtensions.contains(extension)) .toList(); chooseScriptEngineAndRun(e, infos, selectedInfo -> { engineInfo = selectedInfo; executeQuery(project, virtualFile, editor, engineInfo); }); } else { executeQuery(project, virtualFile, editor, engineInfo); } }