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
|
||||
get() =
|
||||
nameIdentifier
|
||||
?: (this as? KtConstructor<*>)?.let {
|
||||
it.getConstructorKeyword() ?: it.getValueParameterList()?.leftParenthesis
|
||||
}
|
||||
?: this
|
||||
nameIdentifier ?: when (this) {
|
||||
is KtConstructor<*> -> getConstructorKeyword() ?: getValueParameterList()?.leftParenthesis
|
||||
is KtObjectDeclaration -> getObjectKeyword()
|
||||
else -> null
|
||||
} ?: this
|
||||
|
||||
private fun collectActualMarkers(
|
||||
declaration: KtNamedDeclaration,
|
||||
|
||||
+5
-5
@@ -331,11 +331,11 @@ private fun collectOverriddenPropertyAccessors(
|
||||
|
||||
private val KtNamedDeclaration.expectOrActualAnchor
|
||||
get() =
|
||||
nameIdentifier
|
||||
?: (this as? KtConstructor<*>)?.let {
|
||||
it.getConstructorKeyword() ?: it.getValueParameterList()?.leftParenthesis
|
||||
}
|
||||
?: this
|
||||
nameIdentifier ?: when (this) {
|
||||
is KtConstructor<*> -> getConstructorKeyword() ?: getValueParameterList()?.leftParenthesis
|
||||
is KtObjectDeclaration -> getObjectKeyword()
|
||||
else -> null
|
||||
} ?: this
|
||||
|
||||
private fun collectActualMarkers(
|
||||
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/");
|
||||
}
|
||||
|
||||
@TestMetadata("fromActualCompanion")
|
||||
public void testFromActualCompanion() throws Exception {
|
||||
runTest("idea/testData/multiModuleLineMarker/fromActualCompanion/");
|
||||
}
|
||||
|
||||
@TestMetadata("fromActualPrimaryConstructor")
|
||||
public void testFromActualPrimaryConstructor() throws Exception {
|
||||
runTest("idea/testData/multiModuleLineMarker/fromActualPrimaryConstructor/");
|
||||
@@ -84,6 +89,11 @@ public class MultiModuleLineMarkerTestGenerated extends AbstractMultiModuleLineM
|
||||
runTest("idea/testData/multiModuleLineMarker/fromCommonToJvmImpl/");
|
||||
}
|
||||
|
||||
@TestMetadata("fromExpectCompanion")
|
||||
public void testFromExpectCompanion() throws Exception {
|
||||
runTest("idea/testData/multiModuleLineMarker/fromExpectCompanion/");
|
||||
}
|
||||
|
||||
@TestMetadata("fromExpectedAnnotation")
|
||||
public void testFromExpectedAnnotation() throws Exception {
|
||||
runTest("idea/testData/multiModuleLineMarker/fromExpectedAnnotation/");
|
||||
|
||||
Reference in New Issue
Block a user