don't include properties with declared return type and property accessors in "show expression type" popup
This commit is contained in:
@@ -37,7 +37,9 @@ class KotlinExpressionTypeProvider : ExpressionTypeProvider<KtExpression>() {
|
||||
|
||||
private fun KtExpression.shouldShowType() = when(this) {
|
||||
is KtFunction -> !hasBlockBody() && !hasDeclaredReturnType()
|
||||
is KtProperty, is KtDestructuringDeclarationEntry -> true
|
||||
is KtProperty -> typeReference == null
|
||||
is KtPropertyAccessor -> false
|
||||
is KtDestructuringDeclarationEntry -> true
|
||||
is KtStatementExpression, is KtDestructuringDeclaration -> false
|
||||
is KtIfExpression, is KtLoopExpression, is KtWhenExpression, is KtTryExpression -> parent !is KtBlockExpression
|
||||
else -> true
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class A {
|
||||
val x: String
|
||||
get() = "a<caret>bc"
|
||||
}
|
||||
|
||||
// TYPE: "abc" -> <html>String</html>
|
||||
Reference in New Issue
Block a user