mirror of
https://github.com/apple/pkl.git
synced 2026-05-25 16:19:20 +02:00
Configure IntelliJ to respect @LateInit annotations (#1606)
IntelliJ can understand that some annotations on fields mean that they are implicitly initialized, which means we don't get the "field XXX is not initialized" warning for `@LateInit` fields. This setting, unfortunately, is recorded into `.idea/misc.xml`, which contains a bunch of arbitrary stuff that we don't want to check into source control This adds some logic to touch up that file to mark `@LateInit` as implicitly initialized fields, so we don't get any editor warnings. Also, suppress some warnings.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
import org.jetbrains.gradle.ext.ActionDelegationConfig
|
||||
import org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM
|
||||
import org.jetbrains.gradle.ext.ProjectSettings
|
||||
import org.jetbrains.gradle.ext.taskTriggers
|
||||
|
||||
plugins {
|
||||
id("pklAllProjects")
|
||||
@@ -36,6 +37,8 @@ nexusPublishing {
|
||||
}
|
||||
}
|
||||
|
||||
val configureLateInitAnnotation by tasks.registering(ConfigureLateInitAnnotation::class)
|
||||
|
||||
idea {
|
||||
project {
|
||||
this as ExtensionAware
|
||||
@@ -45,6 +48,7 @@ idea {
|
||||
delegateBuildRunToGradle = true
|
||||
testRunner = PLATFORM
|
||||
}
|
||||
taskTriggers.afterSync(configureLateInitAnnotation)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user