IntentionAction (final PsiElement errorElement) { final PsiFile containingFile = errorElement.getContainingFile(); final VirtualFile virtualFile = containingFile.getVirtualFile(); final Language language = ((TemplateLanguageFileViewProvider) containingFile.getViewProvider()).getTemplateDataLanguage(); return new IntentionAction() { @Override public @NotNull @Nls String getText() { return LangBundle.message("quickfix.change.template.data.language.text", language.getDisplayName()); } @Override public @NotNull String getFamilyName() { return getText(); } @Override public boolean isAvailable(final @NotNull Project project, final Editor editor, final PsiFile file) { return true; } @Override public void invoke(final @NotNull Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException { final TemplateDataLanguageConfigurable configurable = new TemplateDataLanguageConfigurable(project); ShowSettingsUtil.getInstance().editConfigurable(project, configurable, () -> { if (virtualFile != null) { configurable.selectFile(virtualFile); } }); } @Override public boolean startInWriteAction() { return false; } }; }