KT-34740 Make getImplicitReceiversWithInstanceToExpression keep script implicit receivers
- This makes completion aware of scripts implicit receivers (it matters in .gradle.kts files, for example) - ^KT-34740 Fixed
This commit is contained in:
committed by
Roman Golyshev
parent
be2fe256ba
commit
28e2d2faf2
@@ -0,0 +1,4 @@
|
||||
foo<caret>
|
||||
|
||||
// EXIST: fooBase, fooImplicitBase
|
||||
// NOTHING_ELSE
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package custom.scriptDefinition
|
||||
|
||||
import kotlin.script.experimental.annotations.KotlinScript
|
||||
import kotlin.script.experimental.jvm.dependenciesFromClassContext
|
||||
import kotlin.script.experimental.jvm.jvm
|
||||
import kotlin.script.experimental.api.*
|
||||
|
||||
@KotlinScript(
|
||||
displayName = "Definition for tests",
|
||||
fileExtension = "kts",
|
||||
compilationConfiguration = TemplateDefinition::class
|
||||
)
|
||||
open class Template(val args: Array<String>)
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
object TemplateDefinition : ScriptCompilationConfiguration(
|
||||
{
|
||||
baseClass(Base::class)
|
||||
jvm {
|
||||
dependenciesFromClassContext(TemplateDefinition::class)
|
||||
}
|
||||
ide {
|
||||
acceptedLocations(ScriptAcceptedLocation.Everywhere)
|
||||
}
|
||||
refineConfiguration {
|
||||
beforeCompiling { (_, config, _) ->
|
||||
config.with {
|
||||
implicitReceivers(ImplicitBase::class)
|
||||
}.asSuccess()
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
open class Base {
|
||||
fun fooBase() {}
|
||||
}
|
||||
|
||||
class ImplicitBase {
|
||||
fun fooImplicitBase() {}
|
||||
}
|
||||
Reference in New Issue
Block a user