[param hints] removed intention action to enable custom hints option

This commit is contained in:
Yaroslav Lepenkin
2017-03-16 15:53:14 +03:00
parent f36d77c377
commit 2966c16827
2 changed files with 0 additions and 38 deletions
@@ -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 {
@@ -700,9 +700,6 @@
<intentionAction>
<className>com.intellij.codeInsight.hints.DisableCustomHintsOption</className>
</intentionAction>
<intentionAction>
<className>com.intellij.codeInsight.hints.EnableCustomHintsOption</className>
</intentionAction>
<intentionAction>
<className>com.intellij.codeInsight.intention.impl.QuickEditAction</className>
<category>Language Injection</category>