Show notification "Gradle projects need to be imported" when build.gradle.kts file changed
^KT-19165 Fixed
This commit is contained in:
@@ -62,6 +62,16 @@ class ScriptDefinitionsManager(private val project: Project): ScriptDefinitionPr
|
||||
updateDefinitions()
|
||||
}
|
||||
|
||||
fun getDefinitionsBy(contributor: ScriptDefinitionContributor): List<KotlinScriptDefinition> = lock.write {
|
||||
val notLoadedYet = definitions.isEmpty()
|
||||
if (notLoadedYet) return emptyList()
|
||||
|
||||
if (contributor !in definitionsByContributor) error("Unknown contributor: ${contributor.id}")
|
||||
|
||||
if (contributor.isError()) return emptyList()
|
||||
return definitionsByContributor[contributor] ?: emptyList()
|
||||
}
|
||||
|
||||
private fun currentDefinitions(): List<KotlinScriptDefinition> {
|
||||
val hasDefinitions = definitions.isNotEmpty()
|
||||
when {
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ class ScriptDependenciesUpdater(
|
||||
}
|
||||
}
|
||||
|
||||
private fun requestUpdate(files: Iterable<VirtualFile>) {
|
||||
fun requestUpdate(files: Iterable<VirtualFile>) {
|
||||
files.forEach { file ->
|
||||
if (!file.isValid) {
|
||||
cache.delete(file)
|
||||
|
||||
Reference in New Issue
Block a user