KT-32368 Rework Inline hints settings // HintType cleanup
This commit is contained in:
@@ -415,15 +415,7 @@ hints.settings.lambda.receivers.parameters=Implicit receivers and parameters
|
|||||||
|
|
||||||
hints.settings.suspending=Suspending calls
|
hints.settings.suspending=Suspending calls
|
||||||
|
|
||||||
hints.title.property.type.disabled=Do not show property type hints
|
|
||||||
hints.title.locals.type.disabled=Do not show local variable type hints
|
|
||||||
hints.title.function.type.disabled=Do not show function return type hints
|
|
||||||
hints.title.parameter.type.disabled=Do not show parameter type hints
|
|
||||||
hints.title.argument.name.enabled=Argument name
|
hints.title.argument.name.enabled=Argument name
|
||||||
hints.title.argument.name.disabled=Do not show argument name hints
|
|
||||||
hints.title.return.expression.disabled=Do not show lambda return expression hints
|
|
||||||
hints.title.implicit.parameters.disabled=Do not show hints for implicit receivers and parameters of lambdas
|
|
||||||
hints.title.suspend.calls.disabled=Do not show hints for suspending calls
|
|
||||||
|
|
||||||
presentation.text.paren=({0})
|
presentation.text.paren=({0})
|
||||||
presentation.text.in.container.paren=(in {0})
|
presentation.text.in.container.paren=(in {0})
|
||||||
|
|||||||
@@ -17,11 +17,10 @@ import org.jetbrains.kotlin.psi.psiUtil.endOffset
|
|||||||
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
||||||
|
|
||||||
@Suppress("UnstableApiUsage")
|
@Suppress("UnstableApiUsage")
|
||||||
enum class HintType(private val showDesc: String, val doNotShowDesc: String, defaultEnabled: Boolean) {
|
enum class HintType(private val showDesc: String, defaultEnabled: Boolean) {
|
||||||
|
|
||||||
PROPERTY_HINT(
|
PROPERTY_HINT(
|
||||||
KotlinBundle.message("hints.settings.types.property"),
|
KotlinBundle.message("hints.settings.types.property"),
|
||||||
KotlinBundle.message("hints.title.property.type.disabled"),
|
|
||||||
false
|
false
|
||||||
) {
|
) {
|
||||||
override fun provideHints(elem: PsiElement): List<InlayInfo> {
|
override fun provideHints(elem: PsiElement): List<InlayInfo> {
|
||||||
@@ -33,7 +32,6 @@ enum class HintType(private val showDesc: String, val doNotShowDesc: String, def
|
|||||||
|
|
||||||
LOCAL_VARIABLE_HINT(
|
LOCAL_VARIABLE_HINT(
|
||||||
KotlinBundle.message("hints.settings.types.variable"),
|
KotlinBundle.message("hints.settings.types.variable"),
|
||||||
KotlinBundle.message("hints.title.locals.type.disabled"),
|
|
||||||
false
|
false
|
||||||
) {
|
) {
|
||||||
override fun provideHints(elem: PsiElement): List<InlayInfo> {
|
override fun provideHints(elem: PsiElement): List<InlayInfo> {
|
||||||
@@ -48,7 +46,6 @@ enum class HintType(private val showDesc: String, val doNotShowDesc: String, def
|
|||||||
|
|
||||||
FUNCTION_HINT(
|
FUNCTION_HINT(
|
||||||
KotlinBundle.message("hints.settings.types.return"),
|
KotlinBundle.message("hints.settings.types.return"),
|
||||||
KotlinBundle.message("hints.title.function.type.disabled"),
|
|
||||||
false
|
false
|
||||||
) {
|
) {
|
||||||
override fun provideHints(elem: PsiElement): List<InlayInfo> {
|
override fun provideHints(elem: PsiElement): List<InlayInfo> {
|
||||||
@@ -66,7 +63,6 @@ enum class HintType(private val showDesc: String, val doNotShowDesc: String, def
|
|||||||
|
|
||||||
PARAMETER_TYPE_HINT(
|
PARAMETER_TYPE_HINT(
|
||||||
KotlinBundle.message("hints.settings.types.parameter"),
|
KotlinBundle.message("hints.settings.types.parameter"),
|
||||||
KotlinBundle.message("hints.title.parameter.type.disabled"),
|
|
||||||
false
|
false
|
||||||
) {
|
) {
|
||||||
override fun provideHints(elem: PsiElement): List<InlayInfo> {
|
override fun provideHints(elem: PsiElement): List<InlayInfo> {
|
||||||
@@ -83,7 +79,6 @@ enum class HintType(private val showDesc: String, val doNotShowDesc: String, def
|
|||||||
|
|
||||||
PARAMETER_HINT(
|
PARAMETER_HINT(
|
||||||
KotlinBundle.message("hints.title.argument.name.enabled"),
|
KotlinBundle.message("hints.title.argument.name.enabled"),
|
||||||
KotlinBundle.message("hints.title.argument.name.disabled"),
|
|
||||||
true
|
true
|
||||||
) {
|
) {
|
||||||
override fun provideHints(elem: PsiElement): List<InlayInfo> {
|
override fun provideHints(elem: PsiElement): List<InlayInfo> {
|
||||||
@@ -96,7 +91,6 @@ enum class HintType(private val showDesc: String, val doNotShowDesc: String, def
|
|||||||
|
|
||||||
LAMBDA_RETURN_EXPRESSION(
|
LAMBDA_RETURN_EXPRESSION(
|
||||||
KotlinBundle.message("hints.settings.lambda.return"),
|
KotlinBundle.message("hints.settings.lambda.return"),
|
||||||
KotlinBundle.message("hints.title.return.expression.disabled"),
|
|
||||||
true
|
true
|
||||||
) {
|
) {
|
||||||
override fun isApplicable(elem: PsiElement) =
|
override fun isApplicable(elem: PsiElement) =
|
||||||
@@ -110,7 +104,6 @@ enum class HintType(private val showDesc: String, val doNotShowDesc: String, def
|
|||||||
|
|
||||||
LAMBDA_IMPLICIT_PARAMETER_RECEIVER(
|
LAMBDA_IMPLICIT_PARAMETER_RECEIVER(
|
||||||
KotlinBundle.message("hints.settings.lambda.receivers.parameters"),
|
KotlinBundle.message("hints.settings.lambda.receivers.parameters"),
|
||||||
KotlinBundle.message("hints.title.implicit.parameters.disabled"),
|
|
||||||
true
|
true
|
||||||
) {
|
) {
|
||||||
override fun isApplicable(elem: PsiElement) = elem is KtFunctionLiteral
|
override fun isApplicable(elem: PsiElement) = elem is KtFunctionLiteral
|
||||||
@@ -125,7 +118,6 @@ enum class HintType(private val showDesc: String, val doNotShowDesc: String, def
|
|||||||
|
|
||||||
SUSPENDING_CALL(
|
SUSPENDING_CALL(
|
||||||
KotlinBundle.message("hints.settings.suspending"),
|
KotlinBundle.message("hints.settings.suspending"),
|
||||||
KotlinBundle.message("hints.title.suspend.calls.disabled"),
|
|
||||||
false
|
false
|
||||||
) {
|
) {
|
||||||
override fun isApplicable(elem: PsiElement) = elem.isNameReferenceInCall() && ApplicationManager.getApplication().isInternal
|
override fun isApplicable(elem: PsiElement) = elem.isNameReferenceInCall() && ApplicationManager.getApplication().isInternal
|
||||||
|
|||||||
Reference in New Issue
Block a user