don't include properties with declared return type and property accessors in "show expression type" popup

This commit is contained in:
Dmitry Jemerov
2016-08-26 12:42:09 +02:00
parent e8fcd194f9
commit 2141cd268c
2 changed files with 9 additions and 1 deletions
@@ -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>