From 2966c1682748010f226bfc7c2e395ff962a97c0f Mon Sep 17 00:00:00 2001 From: Yaroslav Lepenkin Date: Thu, 16 Mar 2017 11:47:07 +0300 Subject: [PATCH] [param hints] removed intention action to enable custom hints option --- .../codeInsight/hints/PopupActions.kt | 35 ------------------- .../src/META-INF/LangExtensions.xml | 3 -- 2 files changed, 38 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/PopupActions.kt b/platform/lang-impl/src/com/intellij/codeInsight/hints/PopupActions.kt index 5a1ac60d9183..a67be8799891 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/PopupActions.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/PopupActions.kt @@ -187,41 +187,6 @@ class DisableCustomHintsOption: IntentionAction, HighPriorityAction { } -class EnableCustomHintsOption: IntentionAction, HighPriorityAction { - companion object { - private val presentableFamilyName = CodeInsightBundle.message("inlay.hints.intention.family.name") - } - - private var lastOptionName = "" - - override fun getText(): String = CodeInsightBundle.message("inlay.hints.enable.custom.option", lastOptionName) - override fun getFamilyName(): String = presentableFamilyName - - override fun isAvailable(project: Project, editor: Editor, file: PsiFile): Boolean { - InlayParameterHintsExtension.forLanguage(file.language) ?: return false - if (hasEditorParameterHintAtOffset(editor, file)) return false - - val option = getOptionHintAtOffset(editor, file) ?: return false - lastOptionName = option.optionName - - return true - } - - private fun getOptionHintAtOffset(editor: Editor, file: PsiFile): HintInfo.OptionInfo? { - val offset = editor.caretModel.offset - return getHintInfoFromProvider(offset, file) as? HintInfo.OptionInfo - } - - override fun invoke(project: Project, editor: Editor, file: PsiFile) { - val option = getOptionHintAtOffset(editor, file) ?: return - option.enable() - } - - override fun startInWriteAction() = false -} - - - class ToggleInlineHintsAction : AnAction() { companion object { diff --git a/platform/platform-resources/src/META-INF/LangExtensions.xml b/platform/platform-resources/src/META-INF/LangExtensions.xml index c3d684c2216e..1e80246e229e 100644 --- a/platform/platform-resources/src/META-INF/LangExtensions.xml +++ b/platform/platform-resources/src/META-INF/LangExtensions.xml @@ -700,9 +700,6 @@ com.intellij.codeInsight.hints.DisableCustomHintsOption - - com.intellij.codeInsight.hints.EnableCustomHintsOption - com.intellij.codeInsight.intention.impl.QuickEditAction Language Injection