From 8201f7cf2b5ff5058acdceda3e10112c00ff982d Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Fri, 8 Jun 2018 20:31:48 +0300 Subject: [PATCH] enforce url class loader in stub generator fixes icon lookup when generating stubs --- python/tools/intellij.python.tools.iml | 1 + .../com/jetbrains/python/tools/PyPrebuiltIndicesGenerator.kt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/python/tools/intellij.python.tools.iml b/python/tools/intellij.python.tools.iml index cc5e3d30a367..4d5867cd1d34 100644 --- a/python/tools/intellij.python.tools.iml +++ b/python/tools/intellij.python.tools.iml @@ -16,5 +16,6 @@ + \ No newline at end of file diff --git a/python/tools/src/com/jetbrains/python/tools/PyPrebuiltIndicesGenerator.kt b/python/tools/src/com/jetbrains/python/tools/PyPrebuiltIndicesGenerator.kt index 06f49a3bf54c..f51b74ae05ca 100644 --- a/python/tools/src/com/jetbrains/python/tools/PyPrebuiltIndicesGenerator.kt +++ b/python/tools/src/com/jetbrains/python/tools/PyPrebuiltIndicesGenerator.kt @@ -1,6 +1,7 @@ // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.tools +import com.intellij.ide.BootstrapClassLoaderUtil import com.intellij.idea.IdeaTestApplication import com.intellij.index.PrebuiltIndexAwareIdIndexer import com.intellij.openapi.application.PathManager @@ -67,5 +68,7 @@ private fun createApp(): IdeaTestApplication { candidates[0] = "PyCharm" System.setProperty(PathManager.PROPERTY_PLUGINS_PATH, FileUtil.createTempDirectory("pystubs", "plugins").absolutePath) System.setProperty(PathManager.PROPERTY_SYSTEM_PATH, FileUtil.createTempDirectory("pystubs", "system").absolutePath) + System.setProperty(PathManager.PROPERTY_CONFIG_PATH, FileUtil.createTempDirectory("pystubs", "config").absolutePath) + Thread.currentThread().contextClassLoader = BootstrapClassLoaderUtil.initClassLoader() return IdeaTestApplication.getInstance() }