File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
utbot-intellij-python/src/main/kotlin/org/utbot/intellij/plugin/language/python Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -271,6 +271,20 @@ fun getDirectoriesForSysPath(
271
271
if (ancestor != null && ! sources.contains(ancestor))
272
272
sources.add(ancestor)
273
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
+
274
288
var importPath = ancestor?.let { VfsUtil .getParentDir(VfsUtilCore .getRelativeLocation(file.virtualFile, it)) } ? : " "
275
289
if (importPath != " " )
276
290
importPath + = " ."
You can’t perform that action at this time.
0 commit comments