Method sepatators: separate single-expression functions (KT-30782)
#KT-30782 Fixed
This commit is contained in:
committed by
Nikolay Krasko
parent
ade51588f9
commit
bd661fcf82
@@ -71,7 +71,7 @@ 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)
|
||||||
|
|
||||||
private fun PsiElement.wantsSeparator() = StringUtil.getLineBreakCount(text) > 0
|
private fun PsiElement.wantsSeparator() = this is KtFunction || StringUtil.getLineBreakCount(text) > 0
|
||||||
|
|
||||||
private fun createLineSeparatorByElement(element: PsiElement): LineMarkerInfo<PsiElement> {
|
private fun createLineSeparatorByElement(element: PsiElement): LineMarkerInfo<PsiElement> {
|
||||||
val anchor = PsiTreeUtil.getDeepestFirst(element)
|
val anchor = PsiTreeUtil.getDeepestFirst(element)
|
||||||
|
|||||||
@@ -33,5 +33,10 @@ class Foo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<lineMarker descr="null">fun</lineMarker> quux() {}
|
<lineMarker descr="null">fun</lineMarker> quux() {}
|
||||||
fun xyzzy() {}
|
|
||||||
|
<lineMarker descr="null">fun</lineMarker> xyzzy() {}
|
||||||
|
|
||||||
|
<lineMarker descr="null">fun</lineMarker> f1() = 1
|
||||||
|
|
||||||
|
<lineMarker descr="null">fun</lineMarker> f2() = 2
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user