Expect/actual companion object: set gutter on leaf element
May fix KT-21113
This commit is contained in:
@@ -333,11 +333,11 @@ private fun collectOverriddenPropertyAccessors(
|
|||||||
|
|
||||||
private val KtNamedDeclaration.expectOrActualAnchor
|
private val KtNamedDeclaration.expectOrActualAnchor
|
||||||
get() =
|
get() =
|
||||||
nameIdentifier
|
nameIdentifier ?: when (this) {
|
||||||
?: (this as? KtConstructor<*>)?.let {
|
is KtConstructor<*> -> getConstructorKeyword() ?: getValueParameterList()?.leftParenthesis
|
||||||
it.getConstructorKeyword() ?: it.getValueParameterList()?.leftParenthesis
|
is KtObjectDeclaration -> getObjectKeyword()
|
||||||
}
|
else -> null
|
||||||
?: this
|
} ?: this
|
||||||
|
|
||||||
private fun collectActualMarkers(
|
private fun collectActualMarkers(
|
||||||
declaration: KtNamedDeclaration,
|
declaration: KtNamedDeclaration,
|
||||||
|
|||||||
+5
-5
@@ -331,11 +331,11 @@ private fun collectOverriddenPropertyAccessors(
|
|||||||
|
|
||||||
private val KtNamedDeclaration.expectOrActualAnchor
|
private val KtNamedDeclaration.expectOrActualAnchor
|
||||||
get() =
|
get() =
|
||||||
nameIdentifier
|
nameIdentifier ?: when (this) {
|
||||||
?: (this as? KtConstructor<*>)?.let {
|
is KtConstructor<*> -> getConstructorKeyword() ?: getValueParameterList()?.leftParenthesis
|
||||||
it.getConstructorKeyword() ?: it.getValueParameterList()?.leftParenthesis
|
is KtObjectDeclaration -> getObjectKeyword()
|
||||||
}
|
else -> null
|
||||||
?: this
|
} ?: this
|
||||||
|
|
||||||
private fun collectActualMarkers(
|
private fun collectActualMarkers(
|
||||||
declaration: KtNamedDeclaration,
|
declaration: KtNamedDeclaration,
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
// !CHECK_HIGHLIGHTING
|
||||||
|
|
||||||
|
expect class WithCompanion {
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
actual class <lineMarker>WithCompanion</lineMarker> {
|
||||||
|
actual companion <lineMarker>object</lineMarker> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
expect class <lineMarker>WithCompanion</lineMarker> {
|
||||||
|
companion <lineMarker>object</lineMarker> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
// !CHECK_HIGHLIGHTING
|
||||||
|
|
||||||
|
actual class WithCompanion {
|
||||||
|
actual companion object {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+10
@@ -44,6 +44,11 @@ public class MultiModuleLineMarkerTestGenerated extends AbstractMultiModuleLineM
|
|||||||
runTest("idea/testData/multiModuleLineMarker/fromActualAnnotation/");
|
runTest("idea/testData/multiModuleLineMarker/fromActualAnnotation/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fromActualCompanion")
|
||||||
|
public void testFromActualCompanion() throws Exception {
|
||||||
|
runTest("idea/testData/multiModuleLineMarker/fromActualCompanion/");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("fromActualPrimaryConstructor")
|
@TestMetadata("fromActualPrimaryConstructor")
|
||||||
public void testFromActualPrimaryConstructor() throws Exception {
|
public void testFromActualPrimaryConstructor() throws Exception {
|
||||||
runTest("idea/testData/multiModuleLineMarker/fromActualPrimaryConstructor/");
|
runTest("idea/testData/multiModuleLineMarker/fromActualPrimaryConstructor/");
|
||||||
@@ -84,6 +89,11 @@ public class MultiModuleLineMarkerTestGenerated extends AbstractMultiModuleLineM
|
|||||||
runTest("idea/testData/multiModuleLineMarker/fromCommonToJvmImpl/");
|
runTest("idea/testData/multiModuleLineMarker/fromCommonToJvmImpl/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fromExpectCompanion")
|
||||||
|
public void testFromExpectCompanion() throws Exception {
|
||||||
|
runTest("idea/testData/multiModuleLineMarker/fromExpectCompanion/");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("fromExpectedAnnotation")
|
@TestMetadata("fromExpectedAnnotation")
|
||||||
public void testFromExpectedAnnotation() throws Exception {
|
public void testFromExpectedAnnotation() throws Exception {
|
||||||
runTest("idea/testData/multiModuleLineMarker/fromExpectedAnnotation/");
|
runTest("idea/testData/multiModuleLineMarker/fromExpectedAnnotation/");
|
||||||
|
|||||||
Reference in New Issue
Block a user