From 99fd9dd2d72bfc7d599c4a66a53dde08d4172f71 Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Tue, 15 Oct 2019 18:44:02 +0300 Subject: [PATCH] PY-33254 Added more patterns to cover more path functions from 'os', 'glob', 'shutil' GitOrigin-RevId: 418cef341aad50157bce6a47959651f3ebc9501a --- .../python/codeInsight/PySoftFileReferenceContributor.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/codeInsight/PySoftFileReferenceContributor.kt b/python/src/com/jetbrains/python/codeInsight/PySoftFileReferenceContributor.kt index f36ff169608d..a58f5faa405f 100644 --- a/python/src/com/jetbrains/python/codeInsight/PySoftFileReferenceContributor.kt +++ b/python/src/com/jetbrains/python/codeInsight/PySoftFileReferenceContributor.kt @@ -100,6 +100,8 @@ class PySoftFileReferenceContributor : PsiReferenceContributor() { private val PATTERNS = listOf( Pattern("open", 0, isBuiltin = true), + Pattern("os.walk", 0), + Pattern("os.scandir", 0), Pattern("pandas.read_csv", 0) ) private val SIMPLE_NAMES = PATTERNS.associateBy { it.qualifiedName.lastComponent } @@ -124,7 +126,11 @@ class PySoftFileReferenceContributor : PsiReferenceContributor() { "path", "file", "filename", - "filepath" + "filepath", + "pathname", + "src", + "dst", + "dir" ) private fun matchesPathNamePattern(name: String): Boolean {