We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c69faad commit 08ab8a8Copy full SHA for 08ab8a8
1 file changed
utbot-intellij-python/src/main/kotlin/org/utbot/intellij/plugin/language/python/PythonDialogProcessor.kt
@@ -271,6 +271,20 @@ fun getDirectoriesForSysPath(
271
if (ancestor != null && !sources.contains(ancestor))
272
sources.add(ancestor)
273
274
+ // Collect sys.path directories with imported modules
275
+ file.importTargets.forEach { importTarget ->
276
+ importTarget.multiResolve().forEach {
277
+ val element = it.element
278
+ if (element != null) {
279
+ val directory = element.parent
280
+ if (directory is PsiDirectory) {
281
+ sources.add(directory.virtualFile)
282
+ }
283
284
+
285
286
287
288
var importPath = ancestor?.let { VfsUtil.getParentDir(VfsUtilCore.getRelativeLocation(file.virtualFile, it)) } ?: ""
289
if (importPath != "")
290
importPath += "."
0 commit comments