PY-19127 Fixed: __prepare__ magic function not hightlights

Add __prepare__ to py3 builtin methods
This commit is contained in:
Semyon Proshev
2016-05-18 21:43:45 +03:00
parent cee7d107fd
commit 58fc2f6f70
4 changed files with 11 additions and 1 deletions
@@ -392,6 +392,7 @@ public class PyNames {
.put("__bool__", _only_self_descr)
.put("__bytes__", _only_self_descr)
.put("__format__", new BuiltinDescription("(self, format_spec)"))
.put("__prepare__", new BuiltinDescription("(metacls, name, bases)"))
.put("__round__", new BuiltinDescription("(self, n=None)"))
.put(DUNDER_NEXT, _only_self_descr)
.build();
@@ -0,0 +1,2 @@
class C:
def __prepare__(metacls, name, bases):
@@ -0,0 +1,2 @@
class C:
def __prep<caret>
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -160,6 +160,11 @@ public class Py3CompletionTest extends PyTestCase {
runWithLanguageLevel(LanguageLevel.PYTHON35, () -> doTest());
}
// PY-17828
public void testDunderPrepare() {
runWithLanguageLevel(LanguageLevel.PYTHON30, this::doTest);
}
@Override
protected String getTestDataPath() {
return super.getTestDataPath() + "/completion";