FIR IDE: Add visibility checks to the completion
Visibility checks currently do not work in some cases, for example: - public nested class of private class is seen globally - private_for_this does not work - some other cases I am not yet aware of If `FirVisibilityChecker.isVisible` fix those issues, they will be fixed automatically in the completion
This commit is contained in:
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
package dependency
|
||||
|
||||
class PublicTopLevelClass {
|
||||
class PublicNestedClass
|
||||
protected class ProtectedNestedClass
|
||||
private class PrivateNestedClass
|
||||
|
||||
inner class PublicInnerClass
|
||||
protected inner class ProtectedInnerClass
|
||||
private inner class PrivateInnerClass
|
||||
}
|
||||
|
||||
private class PrivateTopLevelClass
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// FIR_COMPARISON
|
||||
package test
|
||||
|
||||
fun usage(): P<caret> {}
|
||||
|
||||
// EXIST: PublicTopLevelClass, PublicNestedClass, PublicInnerClass
|
||||
// ABSENT: PrivateNestedClass, PrivateInnerClass, ProtectedNestedClass, ProtectedInnerClass, PrivateTopLevelClass
|
||||
+3
-1
@@ -3,4 +3,6 @@ package abc
|
||||
val String.helloProp1: Int get() = 1
|
||||
val String.helloProp2: Int get() = 2
|
||||
val Int.helloProp3: Int get() = 3
|
||||
val helloProp4: Int = 4
|
||||
val helloProp4: Int = 4
|
||||
|
||||
private val String.helloPropPrivate get() = 1
|
||||
+4
-2
@@ -1,3 +1,4 @@
|
||||
// FIR_COMPARISON
|
||||
package first
|
||||
|
||||
fun firstFun() {
|
||||
@@ -5,8 +6,9 @@ fun firstFun() {
|
||||
a.hello<caret>
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "helloProp1", attributes: "bold" }
|
||||
// EXIST: { lookupString: "helloProp2", attributes: "bold" }
|
||||
// EXIST: helloProp1
|
||||
// EXIST: helloProp2
|
||||
// ABSENT: helloProp3
|
||||
// ABSENT: helloProp4
|
||||
// ABSENT: helloPropPrivate
|
||||
// NOTHING_ELSE
|
||||
|
||||
Vendored
+2
@@ -6,3 +6,5 @@ fun globalFun2(): Int = 1
|
||||
object Some {
|
||||
fun globalFun3(): Int = 3
|
||||
}
|
||||
|
||||
private fun globalFunPrivate() {}
|
||||
|
||||
+1
@@ -7,3 +7,4 @@ fun testFun() {
|
||||
|
||||
// EXIST: globalFun1, globalFun2
|
||||
// ABSENT: globalFun3
|
||||
// ABSENT: globalFunPrivate
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package dependency
|
||||
|
||||
private class PrivateTopLevelClass {
|
||||
class PublicNestedClass
|
||||
protected class ProtectedNestedClass
|
||||
private class PrivateNestedClass
|
||||
|
||||
inner class PublicInnerClass
|
||||
protected inner class ProtectedInnerClass
|
||||
private inner class PrivateInnerClass
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
fun usage(): P<caret> {}
|
||||
|
||||
// ABSENT: PrivateTopLevelClass
|
||||
|
||||
// ABSENT: PublicNestedClass
|
||||
// ABSENT: ProtectedNestedClass
|
||||
// ABSENT: PrivateNestedClass
|
||||
|
||||
// ABSENT: PublicInnerClass
|
||||
// ABSENT: ProtectedInnerClass
|
||||
// ABSENT: PrivateInnerClass
|
||||
Vendored
+3
-1
@@ -1,4 +1,6 @@
|
||||
package first
|
||||
|
||||
fun secondFun() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun secondFunPrivate() {}
|
||||
+2
-1
@@ -5,4 +5,5 @@ fun firstFun() {
|
||||
s<caret>
|
||||
}
|
||||
|
||||
// EXIST: secondFun
|
||||
// EXIST: secondFun
|
||||
// ABSENT: secondFunPrivate
|
||||
Reference in New Issue
Block a user