Run invalidating script caches when reindexing is ready (KT-14538)
Explanation why it leads to red code after new project opening 1. No script files are found after project initialization. 2. KotlinScriptDependenciesIndexableSetContributor triggers caching classpath via getAllScriptsClasspath(). Empty classpath is cached. 3. KotlinScriptDependenciesClassFinder.calcClassRoots() always get empty classpath. #KT-14538 In Progress
This commit is contained in:
+2
@@ -57,10 +57,12 @@ class KotlinScriptConfigurationManager(
|
|||||||
reloadScriptDefinitions()
|
reloadScriptDefinitions()
|
||||||
|
|
||||||
StartupManager.getInstance(project).runWhenProjectIsInitialized {
|
StartupManager.getInstance(project).runWhenProjectIsInitialized {
|
||||||
|
DumbService.getInstance(project).smartInvokeLater {
|
||||||
cacheAllScriptsExtraImports()
|
cacheAllScriptsExtraImports()
|
||||||
invalidateLocalCaches()
|
invalidateLocalCaches()
|
||||||
notifyRootsChanged()
|
notifyRootsChanged()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
project.messageBus.connect().subscribe(VirtualFileManager.VFS_CHANGES, object : BulkFileListener.Adapter() {
|
project.messageBus.connect().subscribe(VirtualFileManager.VFS_CHANGES, object : BulkFileListener.Adapter() {
|
||||||
override fun after(events: List<VFileEvent>) {
|
override fun after(events: List<VFileEvent>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user