1e0115aef8
The problem results in broken import quick fix and import optimizer on the IDE side [1]. `AssignResolutionAltererExtension` introduced a possibility to override resolution of assignment statements. The inconsistency though is that `KtSimpleNameReference.getResolvesByNames` doesn't return a name for the overridden `=`. Kotlin as a language doesn't support this [2]. This commit eliminates the drawback above: 1. It fixes the name `assign` the `=` can be resolved to [3]. This eliminates the need to search for the name, bypassing the plugins. 2. `KtSimpleNameReference.getResolvesByNames` returns `assign` among other names in case it deals with binary `=` and assignment is resolved. 3. `KtCompilerPluginsProvider` was extended to check plugins' presence. K1 implementation added. ---------------------------------------------------------------- [1]: https://youtrack.jetbrains.com/issue/KTIJ-24390 [2]: OperatorConventions.getNameForOperationSymbol https://kotlinlang.org/docs/operator-overloading.html#augmented-assignments [3]: OperatorConventions#ASSIGN_METHOD + AssignmentPluginNames
99 lines
3.2 KiB
Kotlin
99 lines
3.2 KiB
Kotlin
plugins {
|
|
kotlin("jvm")
|
|
id("jps-compatible")
|
|
}
|
|
|
|
dependencies {
|
|
api(project(":compiler:psi"))
|
|
api(project(":compiler:fir:fir2ir"))
|
|
api(project(":compiler:ir.tree"))
|
|
api(project(":compiler:fir:resolve"))
|
|
api(project(":compiler:fir:providers"))
|
|
api(project(":compiler:fir:semantics"))
|
|
api(project(":compiler:fir:checkers"))
|
|
api(project(":compiler:fir:checkers:checkers.jvm"))
|
|
api(project(":compiler:fir:checkers:checkers.js"))
|
|
api(project(":compiler:fir:checkers:checkers.native"))
|
|
api(project(":compiler:fir:java"))
|
|
api(project(":compiler:fir:entrypoint"))
|
|
api(project(":analysis:low-level-api-fir"))
|
|
api(project(":analysis:analysis-api"))
|
|
api(project(":analysis:analysis-api-impl-base"))
|
|
api(project(":analysis:light-classes-base"))
|
|
api(project(":compiler:backend.common.jvm"))
|
|
api(intellijCore())
|
|
implementation(project(":analysis:analysis-api-providers"))
|
|
implementation(project(":analysis:analysis-internal-utils"))
|
|
implementation(project(":analysis:kt-references"))
|
|
|
|
testApi(projectTests(":analysis:low-level-api-fir"))
|
|
testApi(projectTests(":compiler:tests-common"))
|
|
testApi(projectTests(":compiler:test-infrastructure-utils"))
|
|
testApi(projectTests(":compiler:test-infrastructure"))
|
|
testApi(projectTests(":compiler:tests-common-new"))
|
|
testApi(projectTests(":compiler:fir:analysis-tests:legacy-fir-tests"))
|
|
testApi(projectTests(":analysis:analysis-api-impl-base"))
|
|
testApi(projectTests(":analysis:decompiled:decompiler-to-file-stubs"))
|
|
testApi(project(":analysis:decompiled:decompiler-to-file-stubs"))
|
|
testApi(project(":analysis:decompiled:decompiler-to-psi"))
|
|
testApi(project(":kotlin-test:kotlin-test-junit"))
|
|
testImplementation(projectTests(":analysis:analysis-test-framework"))
|
|
|
|
testApi(toolsJar())
|
|
testApiJUnit5()
|
|
testApi(project(":analysis:symbol-light-classes"))
|
|
}
|
|
|
|
sourceSets {
|
|
"main" { projectDefault() }
|
|
"test" {
|
|
projectDefault()
|
|
generatedTestDir()
|
|
}
|
|
}
|
|
|
|
projectTest(jUnitMode = JUnitMode.JUnit5) {
|
|
dependsOn(":dist")
|
|
workingDir = rootDir
|
|
useJUnitPlatform()
|
|
}.also { confugureFirPluginAnnotationsDependency(it) }
|
|
|
|
testsJar()
|
|
|
|
allprojects {
|
|
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
|
kotlinOptions {
|
|
freeCompilerArgs += "-opt-in=org.jetbrains.kotlin.fir.symbols.SymbolInternals"
|
|
}
|
|
}
|
|
}
|
|
|
|
val generatorClasspath by configurations.creating
|
|
|
|
dependencies {
|
|
generatorClasspath(project(":analysis:analysis-api-fir:analysis-api-fir-generator"))
|
|
}
|
|
|
|
val generateCode by tasks.registering(NoDebugJavaExec::class) {
|
|
val generatorRoot = "$projectDir/analysis/analysis-api-fir/analysis-api-fir-generator/src/"
|
|
|
|
val generatorConfigurationFiles = fileTree(generatorRoot) {
|
|
include("**/*.kt")
|
|
}
|
|
|
|
inputs.files(generatorConfigurationFiles)
|
|
|
|
workingDir = rootDir
|
|
classpath = generatorClasspath
|
|
mainClass.set("org.jetbrains.kotlin.analysis.api.fir.generator.MainKt")
|
|
systemProperties["line.separator"] = "\n"
|
|
}
|
|
|
|
val compileKotlin by tasks
|
|
|
|
compileKotlin.dependsOn(generateCode)
|
|
|
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
|
kotlinOptions.freeCompilerArgs += "-Xcontext-receivers"
|
|
}
|