Use LibraryJarDescriptor for refreshing jars on plugin update

This commit is contained in:
Dmitry Jemerov
2017-04-03 17:46:30 +02:00
parent 78844dd4aa
commit fe8e02f4cf
@@ -27,7 +27,6 @@ import com.intellij.openapi.vfs.newvfs.NewVirtualFile
import com.intellij.util.indexing.FileBasedIndex import com.intellij.util.indexing.FileBasedIndex
import org.jetbrains.kotlin.idea.KotlinPluginUtil import org.jetbrains.kotlin.idea.KotlinPluginUtil
import org.jetbrains.kotlin.idea.vfilefinder.* import org.jetbrains.kotlin.idea.vfilefinder.*
import org.jetbrains.kotlin.utils.PathUtil
import java.io.File import java.io.File
private val INSTALLED_KOTLIN_VERSION = "installed.kotlin.plugin.version" private val INSTALLED_KOTLIN_VERSION = "installed.kotlin.plugin.version"
@@ -45,16 +44,10 @@ class KotlinUpdatePluginComponent : ApplicationComponent {
val installedKotlinVersion = PropertiesComponent.getInstance()?.getValue(INSTALLED_KOTLIN_VERSION) val installedKotlinVersion = PropertiesComponent.getInstance()?.getValue(INSTALLED_KOTLIN_VERSION)
if (installedKotlinVersion == null || KotlinPluginUtil.getPluginVersion() != installedKotlinVersion) { if (installedKotlinVersion == null || KotlinPluginUtil.getPluginVersion() != installedKotlinVersion) {
val ideaPluginPaths = PathUtil.getKotlinPathsForIdeaPlugin()
// Force refresh jar handlers // Force refresh jar handlers
requestFullJarUpdate(ideaPluginPaths.stdlibPath) for (libraryJarDescriptor in LibraryJarDescriptor.values()) {
requestFullJarUpdate(ideaPluginPaths.reflectPath) requestFullJarUpdate(libraryJarDescriptor.getPathInPlugin())
requestFullJarUpdate(ideaPluginPaths.scriptRuntimePath) }
requestFullJarUpdate(ideaPluginPaths.stdlibSourcesPath)
requestFullJarUpdate(ideaPluginPaths.jsStdLibJarPath)
requestFullJarUpdate(ideaPluginPaths.jsStdLibSrcJarPath)
// Force update indices for files under config directory // Force update indices for files under config directory
val fileBasedIndex = FileBasedIndex.getInstance() val fileBasedIndex = FileBasedIndex.getInstance()