Method sepatators: show separator between companion object and function

#KT-24352 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-09-14 09:09:01 +09:00
committed by Vladimir Dolzhenko
parent 5942446274
commit e8aa14a283
2 changed files with 8 additions and 1 deletions
@@ -65,7 +65,10 @@ class KotlinLineMarkerProvider : LineMarkerProviderDescriptor() {
}
private fun PsiElement?.canHaveSeparator() =
this is KtFunction || this is KtClassInitializer || (this is KtProperty && !isLocal)
this is KtFunction
|| this is KtClassInitializer
|| (this is KtProperty && !isLocal)
|| ((this is KtObjectDeclaration && this.isCompanion()))
private fun PsiElement.wantsSeparator() = this is KtFunction || StringUtil.getLineBreakCount(text) > 0
@@ -39,4 +39,8 @@ class Foo {
<lineMarker descr="null">fun</lineMarker> f1() = 1
<lineMarker descr="null">fun</lineMarker> f2() = 2
<lineMarker descr="null">companion</lineMarker> object {
const val C = 1
}
}