diff --git a/python/psi-api/src/com/jetbrains/python/PyNames.java b/python/psi-api/src/com/jetbrains/python/PyNames.java index 13c091ba06c0..1f0705e64e16 100644 --- a/python/psi-api/src/com/jetbrains/python/PyNames.java +++ b/python/psi-api/src/com/jetbrains/python/PyNames.java @@ -439,6 +439,7 @@ public class PyNames { .putAll(PY35_BUILTIN_METHODS) .put(INIT_SUBCLASS, new BuiltinDescription("(cls, **kwargs)")) .put("__set_name__", new BuiltinDescription("(self, owner, name)")) + .put("__fspath__", _only_self_descr) .build(); public static ImmutableMap getBuiltinMethods(LanguageLevel level) { diff --git a/python/src/com/jetbrains/python/spellchecker/python.dic b/python/src/com/jetbrains/python/spellchecker/python.dic index de9d358620a7..221b9adf44ad 100644 --- a/python/src/com/jetbrains/python/spellchecker/python.dic +++ b/python/src/com/jetbrains/python/spellchecker/python.dic @@ -595,6 +595,7 @@ frozentable frsize fsblkcnt fsfilcnt +fspath fstring ftext ftpcache diff --git a/python/testSrc/com/jetbrains/python/PythonCompletionTest.java b/python/testSrc/com/jetbrains/python/PythonCompletionTest.java index c36c0b839008..f31b36a8a3da 100644 --- a/python/testSrc/com/jetbrains/python/PythonCompletionTest.java +++ b/python/testSrc/com/jetbrains/python/PythonCompletionTest.java @@ -1037,6 +1037,17 @@ public class PythonCompletionTest extends PyTestCase { }); } + // PY-20769 + public void testFsPathBuiltinMethod() { + runWithLanguageLevel(LanguageLevel.PYTHON36, + () -> { + doTestByText("class Cl(object):\n" + + " def __fspa"); + myFixture.checkResult("class Cl(object):\n" + + " def __fspath__(self):"); + }); + } + @Override protected String getTestDataPath() { return super.getTestDataPath() + "/completion";