ScriptDefinitionsManager shouldn't be ready if definitions aren't initialized yet (KT-32554)

Otherwise this can lead to wrong script definition detection on project opening
^KT-32554 Fixed
This commit is contained in:
Natalia Selezneva
2019-07-11 15:51:05 +03:00
parent e40cdef257
commit a2d284c769
@@ -147,7 +147,10 @@ class ScriptDefinitionsManager(private val project: Project) : LazyScriptDefinit
}
fun isReady(): Boolean {
return definitionsBySource.keys.all { source ->
if (definitions == null) {
reloadScriptDefinitions()
}
return definitions != null && definitionsBySource.keys.all { source ->
// TODO: implement another API for readiness checking
(source as? ScriptDefinitionContributor)?.isReady() != false
}