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
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_COMPARISON
|
||||
class Some() {
|
||||
public val testPublic = 12
|
||||
protected val testProtected = 12
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_COMPARISON
|
||||
class Some() {
|
||||
public val testPublic = 12
|
||||
protected val testProtected = 12
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// FIR_COMPARISON
|
||||
package test
|
||||
|
||||
open class Base {
|
||||
public val testPublic = 12
|
||||
protected val testProtected = 12
|
||||
private val testPrivate = 12
|
||||
val testPackage = 12
|
||||
|
||||
fun baseClassMember() {
|
||||
class Local {
|
||||
init {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: testPublic, testProtected, testPackage, testPrivate
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// FIR_COMPARISON
|
||||
package test
|
||||
|
||||
open class Base {
|
||||
public val testPublic = 12
|
||||
protected val testProtected = 12
|
||||
private val testPrivate = 12
|
||||
val testPackage = 12
|
||||
|
||||
fun baseClassMember() {
|
||||
class Local {
|
||||
fun localClassMemeber() {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: testPublic, testProtected, testPackage, testPrivate
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// FIR_COMPARISON
|
||||
package test
|
||||
|
||||
open class BaseClass {
|
||||
companion object {
|
||||
val publicVal = 10
|
||||
fun publicFun() {}
|
||||
|
||||
protected val protectedVal = 30
|
||||
protected fun protectedFun() {}
|
||||
|
||||
private val privateVal = 30
|
||||
private fun privateFun() {}
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
BaseClass.<caret>
|
||||
}
|
||||
|
||||
// EXIST: publicVal
|
||||
// EXIST: publicFun
|
||||
|
||||
// ABSENT: protectedVal
|
||||
// ABSENT: protectedFun
|
||||
// ABSENT: privateVal
|
||||
// ABSENT: privateFun
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// FIR_COMPARISON
|
||||
package test
|
||||
|
||||
open class BaseClass {
|
||||
companion object {
|
||||
val publicVal = 10
|
||||
fun publicFun() {}
|
||||
|
||||
protected val protectedVal = 30
|
||||
protected fun protectedFun() {}
|
||||
|
||||
private val privateVal = 30
|
||||
private fun privateFun() {}
|
||||
}
|
||||
}
|
||||
|
||||
class Subclass : BaseClass() {
|
||||
fun test() {
|
||||
BaseClass.<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: publicVal
|
||||
// EXIST: publicFun
|
||||
// EXIST: protectedVal
|
||||
// EXIST: protectedFun
|
||||
|
||||
// ABSENT: privateVal
|
||||
// ABSENT: privateFun
|
||||
Reference in New Issue
Block a user