mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[param hints] removed intention action to enable custom hints option
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user