Method sepatators: show separator between companion object and function
#KT-24352 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
5942446274
commit
e8aa14a283
@@ -65,7 +65,10 @@ class KotlinLineMarkerProvider : LineMarkerProviderDescriptor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun PsiElement?.canHaveSeparator() =
|
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
|
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> f1() = 1
|
||||||
|
|
||||||
<lineMarker descr="null">fun</lineMarker> f2() = 2
|
<lineMarker descr="null">fun</lineMarker> f2() = 2
|
||||||
|
|
||||||
|
<lineMarker descr="null">companion</lineMarker> object {
|
||||||
|
const val C = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user