From 06b85d2f21bfe8562cbb8c49416e6b6e8375cc6c Mon Sep 17 00:00:00 2001 From: Dmitry Cheryasov Date: Tue, 25 May 2010 19:57:32 +0300 Subject: [PATCH] Builtins highlighting: fixed a regression, added a test. --- .../com/jetbrains/python/validation/PyBuiltinAnnotator.java | 4 ++-- python/testData/highlighting/builtins.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/src/com/jetbrains/python/validation/PyBuiltinAnnotator.java b/python/src/com/jetbrains/python/validation/PyBuiltinAnnotator.java index 67d443181fe7..b8a332414d79 100644 --- a/python/src/com/jetbrains/python/validation/PyBuiltinAnnotator.java +++ b/python/src/com/jetbrains/python/validation/PyBuiltinAnnotator.java @@ -64,12 +64,12 @@ public class PyBuiltinAnnotator extends PyAnnotator { if (tgt != null) { Annotation ann = getHolder().createInfoAnnotation(tgt, null); ann.setTextAttributes(PyHighlighter.PY_PREDEFINED_USAGE); + return true; } } } - return false; } - return true; + return false; } } diff --git a/python/testData/highlighting/builtins.py b/python/testData/highlighting/builtins.py index def33dc64a36..7286ceb9ca3d 100644 --- a/python/testData/highlighting/builtins.py +++ b/python/testData/highlighting/builtins.py @@ -3,12 +3,14 @@ # func decl: red bold # class decl: blue bold # predefined decl: green bold +# predefined usage: yellow bold len("") len = [] # redefine len # no highlight class A(object): + __metaclass__ = M # assignment target @classmethod def foo(cls):