From cb9004e83ea2986cc4254abba71a33efce59da4b Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Wed, 16 Oct 2019 20:42:33 +0300 Subject: [PATCH] PY-38557 Don't complete file paths in any but first argument of open() GitOrigin-RevId: 4fc61e59a1ddc89696a8e9e315b1dc0a0d3de4a5 --- .../python/codeInsight/PySoftFileReferenceContributor.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/codeInsight/PySoftFileReferenceContributor.kt b/python/src/com/jetbrains/python/codeInsight/PySoftFileReferenceContributor.kt index d08241cc95c3..e544bef4c1e1 100644 --- a/python/src/com/jetbrains/python/codeInsight/PySoftFileReferenceContributor.kt +++ b/python/src/com/jetbrains/python/codeInsight/PySoftFileReferenceContributor.kt @@ -109,7 +109,7 @@ class PySoftFileReferenceContributor : PsiReferenceContributor() { // Fail-fast check val simplePattern = SIMPLE_NAMES[callee.name] ?: return false - if (simplePattern.isBuiltin) return true + if (simplePattern.isBuiltin && argList.arguments.indexOf(expr) == simplePattern.position) return true val pattern = PyResolveUtil.resolveImportedElementQNameLocally(callee).map { QUALIFIED_NAMES[it] }.firstOrNull() ?: return false return argList.arguments.getOrNull(pattern.position) == expr